diff mbox series

[07/14] mtd: spear_smi: Drop if with an always false condition

Message ID 20220603210758.148493-8-u.kleine-koenig@pengutronix.de
State Accepted
Headers show
Series mtd: Fix platform remove callbacks to always return 0 | expand

Commit Message

Uwe Kleine-König June 3, 2022, 9:07 p.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 dev is never NULL.

This is a preparation for making platform remove callbacks return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/mtd/devices/spear_smi.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Miquel Raynal June 9, 2022, 1:09 p.m. UTC | #1
On Fri, 2022-06-03 at 21:07:51 UTC, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= wrote:
> 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 dev is never NULL.
> 
> This is a preparation for making platform remove callbacks return void.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel
diff mbox series

Patch

diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index f6febe6662db..f58742486d3d 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -1048,10 +1048,6 @@  static int spear_smi_remove(struct platform_device *pdev)
 	int i;
 
 	dev = platform_get_drvdata(pdev);
-	if (!dev) {
-		dev_err(&pdev->dev, "dev is null\n");
-		return -ENODEV;
-	}
 
 	/* clean up for all nor flash */
 	for (i = 0; i < dev->num_flashes; i++) {