Message ID | 20190627092411.26123-6-ckeepax@opensource.cirrus.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | I2C IRQ Probe Improvements | expand |
On Thu, Jun 27, 2019 at 10:24:10AM +0100, Charles Keepax wrote: > It makes sense to contain all the ACPI IRQ handling in a single helper > function. > > 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>
diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index eaf45cf8e5b91..3707823efa850 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -168,6 +168,9 @@ int i2c_acpi_get_irq(struct i2c_client *client) acpi_dev_free_resource_list(&resource_list); + if (irq == -ENOENT) + irq = acpi_dev_gpio_irq_get(adev, 0); + return irq; } diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index c8fa2b825dcef..f0e1d338c7ddf 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -328,9 +328,6 @@ static int i2c_device_probe(struct device *dev) irq = of_irq_get(dev->of_node, 0); } else if (ACPI_COMPANION(dev)) { 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;