[v2,2/4] gpio: dwapb: avoid error message for optional IRQ

Message ID 20200518174138.19367-2-andriy.shevchenko@linux.intel.com
State New
Headers show
  • [v2,1/4] gpio: dwapb: Call acpi_gpiochip_free_interrupts() on GPIO chip de-registration
Related show

Commit Message

Andy Shevchenko May 18, 2020, 5:41 p.m.
platform_get_irq() will generate an error message if the requested IRQ
is not present. Use platform_get_irq_optional() to avoid the error message
being generated.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
v2: added Rb tag (Serge)
 drivers/gpio/gpio-dwapb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index e5d844304f8d..944dae80d687 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -549,7 +549,7 @@  static void dwapb_get_irq(struct device *dev, struct fwnode_handle *fwnode,
 		if (np)
 			pp->irq[j] = of_irq_get(np, j);
 		else if (has_acpi_companion(dev))
-			pp->irq[j] = platform_get_irq(to_platform_device(dev), j);
+			pp->irq[j] = platform_get_irq_optional(to_platform_device(dev), j);
 		if (pp->irq[j] >= 0)
 			pp->has_irq = true;