diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2014-08-08 12:07:51 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-08-17 09:12:35 -0500 |
commit | 8a69155040bf8745a9a95da8cbaab2940b4093d5 (patch) | |
tree | ef32eee4ef3c22a000eb0a133c3fc4903ca96894 /drivers/gpio/gpiolib-of.c | |
parent | 6dd859508336f0fd078fd62f3b9fe42a32aa38e2 (diff) | |
download | blackbird-op-linux-8a69155040bf8745a9a95da8cbaab2940b4093d5.tar.gz blackbird-op-linux-8a69155040bf8745a9a95da8cbaab2940b4093d5.zip |
gpio: delete unneeded test before of_node_put
Of_node_put supports NULL as its argument, so the initial test is not
necessary.
Suggested by Uwe Kleine-König.
The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e;
@@
-if (e)
of_node_put(e);
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib-of.c')
-rw-r--r-- | drivers/gpio/gpiolib-of.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 7cfdc2278905..604dbe60bdee 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -307,7 +307,5 @@ void of_gpiochip_add(struct gpio_chip *chip) void of_gpiochip_remove(struct gpio_chip *chip) { gpiochip_remove_pin_ranges(chip); - - if (chip->of_node) - of_node_put(chip->of_node); + of_node_put(chip->of_node); } |