diff mbox series

ARM: pxa: ssp: Drop if with an always false condition

Message ID 20210727065514.3447824-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series ARM: pxa: ssp: Drop if with an always false condition | expand

Commit Message

Uwe Kleine-König July 27, 2021, 6:55 a.m. UTC
The remove callback is only called after probe completed successfully.
In this case platform_set_drvdata() was called with a non-NULL argument
and so ssp is never NULL.

The motivation for this change is to get rid of non-zero return values
for remove callbacks as their only effect is to trigger a runtime
warning. See commit e5e1c2097881 ("driver core: platform: Emit a warning
if a remove callback returned non-zero") for further details.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/arm/plat-pxa/ssp.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index 563440315acd..41f9fc50fca8 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -183,8 +183,6 @@  static int pxa_ssp_remove(struct platform_device *pdev)
 	struct ssp_device *ssp;
 
 	ssp = platform_get_drvdata(pdev);
-	if (ssp == NULL)
-		return -ENODEV;
 
 	mutex_lock(&ssp_lock);
 	list_del(&ssp->node);