Skip to content

Commit

Permalink
gpio: pl061: Warn when IRQ line has not been configured
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
  • Loading branch information
Alexander Sverdlin authored and Bartosz Golaszewski committed Mar 25, 2020
1 parent f8c3cea commit 1a55571
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/gpio/gpio-pl061.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1a55571

Please sign in to comment.