From: Uwe Kleine-König Date: Fri, 3 Jun 2022 21:07:51 +0000 (+0200) Subject: mtd: spear_smi: Drop if with an always false condition X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=279d719be39d8edb37c9178c15e167a94c7bc0a0;p=linux.git mtd: spear_smi: Drop if with an always false condition 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 Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220603210758.148493-8-u.kleine-koenig@pengutronix.de --- diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c index f6febe6662dbb..f58742486d3de 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++) {