diff mbox series

[02/20] pinctrl: single: Drop if block with always false condition

Message ID 20231009083856.222030-3-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series pinctrl: Convert to platform remove callback returning void | expand

Commit Message

Uwe Kleine-König Oct. 9, 2023, 8:38 a.m. UTC
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>
---
 drivers/pinctrl/pinctrl-single.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Linus Walleij Oct. 10, 2023, 1:36 p.m. UTC | #1
On Mon, Oct 9, 2023 at 11:22 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:


> 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>

Patch applied.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 461a7c02d4a3..f6c02c8b934d 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -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;