gpio: xlp: fix error return code
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 23 Aug 2015 00:11:22 +0000 (02:11 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 26 Aug 2015 12:49:23 +0000 (14:49 +0200)
commita0c81ce08791d3892aacba341efa29fadf30beda
tree60fc6247ea7fdbdaa98f2b78db9bf5cd5ec1f994
parentfd96811576e646011489e38b0594dc017db21971
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>
drivers/gpio/gpio-xlp.c