Message ID | 20231009083856.222030-4-u.kleine-koenig@pengutronix.de |
---|---|
State | Accepted |
Commit | 88b3f108502bc45e6ebd005702add46759f3f45a |
Headers | show |
Series | [01/20] pinctrl: stmfx: Improve error message in .remove()'s error path | expand |
On Mon, Oct 9, 2023 at 11:22 AM Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote: > ti_iodelay_remove() is only called after ti_iodelay_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 --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c index c1477f657839..f3a273562095 100644 --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c @@ -903,9 +903,6 @@ static int ti_iodelay_remove(struct platform_device *pdev) { struct ti_iodelay_device *iod = platform_get_drvdata(pdev); - if (!iod) - return 0; - if (iod->pctl) pinctrl_unregister(iod->pctl);
ti_iodelay_remove() is only called after ti_iodelay_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/ti/pinctrl-ti-iodelay.c | 3 --- 1 file changed, 3 deletions(-)