OSDN Git Service

ACPI / utils: Introduce acpi_dev_get_first_match_dev() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 18 Mar 2019 20:00:54 +0000 (23:00 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 1 Apr 2019 08:55:56 +0000 (10:55 +0200)
commit817b4d64da036f5559297a2fdb82b8b14f4ffdcd
treefa02639adb2da258699965d4e2c222d38f0edca5
parent79a3aaa7b82e3106be97842dedfd8429248896e6
ACPI / utils: Introduce acpi_dev_get_first_match_dev() helper

The acpi_dev_get_first_match_name() is missing put_device() call
and thus keeping reference counting unbalanced.

In order to fix the issue introduce a new helper to convert existing users
one-by-one to a better API.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/utils.c
include/acpi/acpi_bus.h
include/linux/acpi.h