Browse Source

gpio: tz1090: Fix error handling of irq_of_parse_and_map

irq_of_parse_and_map() returns 0 on error, so testing for negative
result never works.

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Dmitry Torokhov 10 years ago
parent
commit
842e528e1a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/gpio/gpio-tz1090.c

+ 1 - 1
drivers/gpio/gpio-tz1090.c

@@ -446,7 +446,7 @@ static int tz1090_gpio_bank_probe(struct tz1090_gpio_bank_info *info)
 	bank->irq = irq_of_parse_and_map(np, 0);
 
 	/* The interrupt is optional (it may be used by another core on chip) */
-	if (bank->irq < 0) {
+	if (!bank->irq) {
 		dev_info(dev, "IRQ not provided for bank %u, IRQs disabled\n",
 			 info->index);
 		return 0;