OSDN Git Service

pinctrl: Delete unnecessary checks
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 5 Nov 2015 16:10:22 +0000 (17:10 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 17 Nov 2015 10:49:50 +0000 (11:49 +0100)
The pinctrl_unregister() 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 <elfring@users.sourceforge.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c
drivers/pinctrl/pinctrl-single.c

index 12a48f4..663ad0a 100644 (file)
@@ -638,8 +638,7 @@ static int cygnus_gpio_register_pinconf(struct cygnus_gpio *chip)
 
 static void cygnus_gpio_unregister_pinconf(struct cygnus_gpio *chip)
 {
-       if (chip->pctl)
-               pinctrl_unregister(chip->pctl);
+       pinctrl_unregister(chip->pctl);
 }
 
 struct cygnus_gpio_data {
index ef04b96..d24e5f1 100644 (file)
@@ -1484,10 +1484,7 @@ static void pcs_irq_free(struct pcs_device *pcs)
 static void pcs_free_resources(struct pcs_device *pcs)
 {
        pcs_irq_free(pcs);
-
-       if (pcs->pctl)
-               pinctrl_unregister(pcs->pctl);
-
+       pinctrl_unregister(pcs->pctl);
        pcs_free_funcs(pcs);
        pcs_free_pingroups(pcs);
 }