summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-core-base.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2019-06-27 12:24:09 +0300
committerWolfram Sang <wsa@the-dreams.de>2019-06-29 14:17:44 +0300
commit16c9db1dd84cef50c819733a19def842bdb3d5ef (patch)
tree991e9206488f2d1ed3cbce7757c0d11c87e53e3b /drivers/i2c/i2c-core-base.c
parenta52e3b37ebc9dff9e5750ce9ef68cf78be5a9d77 (diff)
downloadlinux-16c9db1dd84cef50c819733a19def842bdb3d5ef.tar.xz
i2c: core: Move ACPI IRQ handling to probe time
Bring the ACPI path in sync with the device tree path and handle all the IRQ fetching at probe time. This leaves the only IRQ handling at device registration time being that which is passed directly through the board info as either a resource or an actual IRQ number. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> 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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index fd4ecc9981b7..c4dbd0a9212b 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -335,7 +335,10 @@ static int i2c_device_probe(struct device *dev)
if (irq == -EINVAL || irq == -ENODATA)
irq = of_irq_get(dev->of_node, 0);
} else if (ACPI_COMPANION(dev)) {
- irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 0);
+ irq = i2c_acpi_get_irq(client);
+
+ if (irq == -ENOENT)
+ irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 0);
}
if (irq == -EPROBE_DEFER)
return irq;