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

i2c: core: Don't fail PRP0001 enumeration when no ID table exist

When commit c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case
as well") fixed the enumeration of I²C devices on ACPI enabled platforms
when driver has no ID table, it missed the PRP0001 support.

i2c_device_match() and i2c_acpi_match_device() differently match
driver against given device. Use acpi_driver_match_device(), that is used
in the former, in i2c_device_probe() and don't fail PRP0001 enumeration
when no ID table exist.

Fixes: c64ffff7a9d1 ("i2c: core: Allow empty id_table in ACPI case as well")
BugLink: https://stackoverflow.com/q/63519678/2511795
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

authored by

Andy Shevchenko and committed by
Wolfram Sang
e3cb82c6 d012a719

+1 -1
+1 -1
drivers/i2c/i2c-core-base.c
··· 480 480 * or ACPI ID table is supplied for the probing device. 481 481 */ 482 482 if (!driver->id_table && 483 - !i2c_acpi_match_device(dev->driver->acpi_match_table, client) && 483 + !acpi_driver_match_device(dev, dev->driver) && 484 484 !i2c_of_match_device(dev->driver->of_match_table, client)) { 485 485 status = -ENODEV; 486 486 goto put_sync_adapter;