diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2015-08-22 20:11:22 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-08-26 08:49:23 -0400 |
commit | a0c81ce08791d3892aacba341efa29fadf30beda (patch) | |
tree | 60fc6247ea7fdbdaa98f2b78db9bf5cd5ec1f994 /drivers/gpio/gpio-xlp.c | |
parent | fd96811576e646011489e38b0594dc017db21971 (diff) |
gpio: xlp: fix error return code
Return a negative error code on failure.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-xlp.c')
-rw-r--r-- | drivers/gpio/gpio-xlp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c index 9bdab7203d65..e02499a15e72 100644 --- a/drivers/gpio/gpio-xlp.c +++ b/drivers/gpio/gpio-xlp.c | |||
@@ -387,7 +387,7 @@ static int xlp_gpio_probe(struct platform_device *pdev) | |||
387 | irq_base = irq_alloc_descs(-1, XLP_GPIO_IRQ_BASE, gc->ngpio, 0); | 387 | irq_base = irq_alloc_descs(-1, XLP_GPIO_IRQ_BASE, gc->ngpio, 0); |
388 | if (irq_base < 0) { | 388 | if (irq_base < 0) { |
389 | dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n"); | 389 | dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n"); |
390 | return err; | 390 | return -ENODEV; |
391 | } | 391 | } |
392 | 392 | ||
393 | err = gpiochip_add(gc); | 393 | err = gpiochip_add(gc); |