Skip to content

Commit

Permalink
gpio: em: Fix checking return value of irq_alloc_descs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Linus Walleij committed Aug 31, 2012
1 parent 4c30aa3 commit dd29149
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpio/gpio-em.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ static int __devinit em_gio_irq_domain_init(struct em_gio_priv *p)

p->irq_base = irq_alloc_descs(pdata->irq_base, 0,
pdata->number_of_pins, numa_node_id());
if (IS_ERR_VALUE(p->irq_base)) {
if (p->irq_base < 0) {
dev_err(&pdev->dev, "cannot get irq_desc\n");
return -ENXIO;
return p->irq_base;
}
pr_debug("gio: hw base = %d, nr = %d, sw base = %d\n",
pdata->gpio_base, pdata->number_of_pins, p->irq_base);
Expand Down

0 comments on commit dd29149

Please sign in to comment.