summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core-base.c
diff options
context:
space:
mode:
authorAndy Shevchenko2017-07-17 16:13:28 +0200
committerWolfram Sang2017-07-31 15:50:33 +0200
commitc64ffff7a9d1eee6624d3eaab36968fe6df31a9f (patch)
treeaf1c1ce0e4a1488ba9ab00ad80ec3b723800913b /drivers/i2c/i2c-core-base.c
parentLinux 4.13-rc3 (diff)
downloadkernel-qcow2-linux-c64ffff7a9d1eee6624d3eaab36968fe6df31a9f.tar.gz
kernel-qcow2-linux-c64ffff7a9d1eee6624d3eaab36968fe6df31a9f.tar.xz
kernel-qcow2-linux-c64ffff7a9d1eee6624d3eaab36968fe6df31a9f.zip
i2c: core: Allow empty id_table in ACPI case as well
For now empty ID table is not allowed with ACPI and prevents driver to be probed. Add a check to allow empty ID table. This introduces a helper i2c_acpi_match_device(). Note, we rename some static function in i2c-core-acpi.c to distinguish with public API. Fixes: da10c06a044b ("i2c: Make I2C ID tables non-mandatory for DT'ed devices") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Rajmohan Mani <rajmohan.mani@intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> [wsa: needed to get some drivers probed again] Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/i2c-core-base.c')
-rw-r--r--drivers/i2c/i2c-core-base.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index c89dac7fd2e7..12822a4b8f8f 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -357,6 +357,7 @@ static int i2c_device_probe(struct device *dev)
* Tree match table entry is supplied for the probing device.
*/
if (!driver->id_table &&
+ !i2c_acpi_match_device(dev->driver->acpi_match_table, client) &&
!i2c_of_match_device(dev->driver->of_match_table, client))
return -ENODEV;