From: Julia Lawall Date: Fri, 8 Aug 2014 10:07:51 +0000 (+0200) Subject: gpio: delete unneeded test before of_node_put X-Git-Tag: v3.17-rc2~8^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8a69155040bf8745a9a95da8cbaab2940b4093d5;p=karo-tx-linux.git 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/) // @@ expression e; @@ -if (e) of_node_put(e); // Signed-off-by: Julia Lawall Signed-off-by: Linus Walleij --- 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); }