pinctrl: single: Drop if block with always false condition
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 9 Oct 2023 08:38:38 +0000 (10:38 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 10 Oct 2023 13:35:56 +0000 (15:35 +0200)
pcs_remove() is only called after pcs_probe() completed successfully. In
this case platform_set_drvdata() was called with a non-NULL argument and
so platform_get_drvdata() won't return NULL.

Simplify by removing the if block with the always false condition.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231009083856.222030-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-single.c

index 68dc94da777a89e4b09d34a0570d13818c64cfd8..de4dc7e6750356e700d1e5c4811fe7140ebb6a63 100644 (file)
@@ -1929,9 +1929,6 @@ static int pcs_remove(struct platform_device *pdev)
 {
        struct pcs_device *pcs = platform_get_drvdata(pdev);
 
-       if (!pcs)
-               return 0;
-
        pcs_free_resources(pcs);
 
        return 0;