diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2014-08-08 06:07:51 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-08-17 10:12:35 -0400 |
commit | 8a69155040bf8745a9a95da8cbaab2940b4093d5 (patch) | |
tree | ef32eee4ef3c22a000eb0a133c3fc4903ca96894 | |
parent | 6dd859508336f0fd078fd62f3b9fe42a32aa38e2 (diff) |
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>
-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) | |||
307 | void of_gpiochip_remove(struct gpio_chip *chip) | 307 | void of_gpiochip_remove(struct gpio_chip *chip) |
308 | { | 308 | { |
309 | gpiochip_remove_pin_ranges(chip); | 309 | gpiochip_remove_pin_ranges(chip); |
310 | 310 | of_node_put(chip->of_node); | |
311 | if (chip->of_node) | ||
312 | of_node_put(chip->of_node); | ||
313 | } | 311 | } |