From: Markus Elfring Date: Tue, 3 Feb 2015 10:54:28 +0000 (+0100) Subject: pwm: Remove unnecessary check before of_node_put() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8d6cc0738540f97edb021d3b76a4367519f1e5f1;p=linux-beck.git pwm: Remove unnecessary check before of_node_put() The of_node_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Thierry Reding --- diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 966497d10c6e..810aef3f4c3e 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -192,7 +192,7 @@ static void of_pwmchip_add(struct pwm_chip *chip) static void of_pwmchip_remove(struct pwm_chip *chip) { - if (chip->dev && chip->dev->of_node) + if (chip->dev) of_node_put(chip->dev->of_node); }