aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-08-28 07:30:44 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-08-31 19:18:39 -0400
commitdd2914972e5f6d9c1a687158c0f65b81d239fe37 (patch)
tree17ac0aed21b9898bf4844686ca437e9ff329ddfe
parent4c30aa33d4b4ce9a0ee5b32d058a40f4eca2ab63 (diff)
gpio: em: Fix checking return value of irq_alloc_descs
irq_alloc_descs() returns negative error code on failure. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Magnus Damm <damm@opensource.se> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/gpio/gpio-em.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
index ae37181798b..ec48ed51262 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -247,9 +247,9 @@ static int __devinit em_gio_irq_domain_init(struct em_gio_priv *p)
247 247
248 p->irq_base = irq_alloc_descs(pdata->irq_base, 0, 248 p->irq_base = irq_alloc_descs(pdata->irq_base, 0,
249 pdata->number_of_pins, numa_node_id()); 249 pdata->number_of_pins, numa_node_id());
250 if (IS_ERR_VALUE(p->irq_base)) { 250 if (p->irq_base < 0) {
251 dev_err(&pdev->dev, "cannot get irq_desc\n"); 251 dev_err(&pdev->dev, "cannot get irq_desc\n");
252 return -ENXIO; 252 return p->irq_base;
253 } 253 }
254 pr_debug("gio: hw base = %d, nr = %d, sw base = %d\n", 254 pr_debug("gio: hw base = %d, nr = %d, sw base = %d\n",
255 pdata->gpio_base, pdata->number_of_pins, p->irq_base); 255 pdata->gpio_base, pdata->number_of_pins, p->irq_base);