media: ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro
authorDaniel Scally <djrscally@gmail.com>
Thu, 7 Jan 2021 13:28:36 +0000 (14:28 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 26 Jan 2021 18:34:29 +0000 (19:34 +0100)
commitbf263f64e804a74ace9bd37f49341d68a653e5e6
treeddd17a9a5542b38da413fe6b6097e06744e099f8
parent06c85233121fabc69ffe6124953cd5304dbf3afd
media: ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro

To ensure we handle situations in which multiple sensors of the same
model (and therefore _HID) are present in a system, we need to be able
to iterate over devices matching a known _HID but unknown _UID and _HRV
 - add acpi_dev_get_next_match_dev() to accommodate that possibility and
change acpi_dev_get_first_match_dev() to simply call the new function
with a NULL starting point. Add an iterator macro for convenience.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/acpi/utils.c
include/acpi/acpi_bus.h