Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

driver core: Provide device_match_acpi_handle() helper

We have a couple of users of this helper, make it available for them.

The prototype for the helper is specifically crafted in order to be
easily used with bus_find_device() call. That's why its location is
in the driver core rather than ACPI.

Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211014134756.39092-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
a164ff53 b5bc8ac2

+7
+6
drivers/base/core.c
··· 4838 4838 } 4839 4839 EXPORT_SYMBOL(device_match_acpi_dev); 4840 4840 4841 + int device_match_acpi_handle(struct device *dev, const void *handle) 4842 + { 4843 + return ACPI_HANDLE(dev) == handle; 4844 + } 4845 + EXPORT_SYMBOL(device_match_acpi_handle); 4846 + 4841 4847 int device_match_any(struct device *dev, const void *unused) 4842 4848 { 4843 4849 return 1;
+1
include/linux/device/bus.h
··· 143 143 int device_match_fwnode(struct device *dev, const void *fwnode); 144 144 int device_match_devt(struct device *dev, const void *pdevt); 145 145 int device_match_acpi_dev(struct device *dev, const void *adev); 146 + int device_match_acpi_handle(struct device *dev, const void *handle); 146 147 int device_match_any(struct device *dev, const void *unused); 147 148 148 149 /* iterator helpers for buses */