linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: pl061: Warn when IRQ line has not been configured
@ 2020-03-03  9:28 Alexander A Sverdlin
  2020-03-04 14:21 ` Bartosz Golaszewski
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander A Sverdlin @ 2020-03-03  9:28 UTC (permalink / raw)
  To: linux-gpio; +Cc: Alexander Sverdlin, Linus Walleij, Bartosz Golaszewski

From: Alexander Sverdlin <alexander.sverdlin@nokia.com>

Existing (irq < 0) condition is always false because adev->irq has unsigned
type and contains 0 in case of failed irq_of_parse_and_map(). Up to now all
the mapping errors were silently ignored.

Seems that repairing this check would be backwards-incompatible and might
break the probe() for the implementations without IRQ support. Therefore
warn the user instead.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
 drivers/gpio/gpio-pl061.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 5df7782..3439120 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -326,10 +326,8 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
 
 	writeb(0, pl061->base + GPIOIE); /* disable irqs */
 	irq = adev->irq[0];
-	if (irq < 0) {
-		dev_err(&adev->dev, "invalid IRQ\n");
-		return -ENODEV;
-	}
+	if (!irq)
+		dev_warn(&adev->dev, "IRQ support disabled\n");
 	pl061->parent_irq = irq;
 
 	girq = &pl061->gc.irq;
-- 
2.4.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread
[parent not found: <20210317155919.41450-1-alexander.sverdlin@nokia.com>]

end of thread, other threads:[~2021-03-18 12:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-03  9:28 [PATCH] gpio: pl061: Warn when IRQ line has not been configured Alexander A Sverdlin
2020-03-04 14:21 ` Bartosz Golaszewski
2020-03-04 14:58   ` Alexander Sverdlin
2020-03-04 16:46     ` Bartosz Golaszewski
     [not found] <20210317155919.41450-1-alexander.sverdlin@nokia.com>
2021-03-17 15:59 ` Alexander A Sverdlin
     [not found]   ` <CAHp75Vd-iUzEyo5X5LtKJ+66512i5-tKC+kkpPYJwG7L2qrvdw@mail.gmail.com>
2021-03-18 11:11     ` Alexander Sverdlin
2021-03-18 12:19       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).