Message ID | 20231102220246.3336154-9-u.kleine-koenig@pengutronix.de |
---|---|
State | Accepted |
Headers | show |
Series | mtd: Convert to platform remove callback returning (part II) | expand |
On Thu, 2023-11-02 at 22:02:50 UTC, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= wrote: > txx9ndfmc_remove() is only called after txx9ndfmc_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> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel
diff --git a/drivers/mtd/nand/raw/txx9ndfmc.c b/drivers/mtd/nand/raw/txx9ndfmc.c index 9d6c62f73bb7..fdcdfbea0cbd 100644 --- a/drivers/mtd/nand/raw/txx9ndfmc.c +++ b/drivers/mtd/nand/raw/txx9ndfmc.c @@ -374,8 +374,6 @@ static int txx9ndfmc_remove(struct platform_device *dev) struct txx9ndfmc_drvdata *drvdata = platform_get_drvdata(dev); int ret, i; - if (!drvdata) - return 0; for (i = 0; i < MAX_TXX9NDFMC_DEV; i++) { struct mtd_info *mtd = drvdata->mtds[i]; struct nand_chip *chip;
txx9ndfmc_remove() is only called after txx9ndfmc_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/mtd/nand/raw/txx9ndfmc.c | 2 -- 1 file changed, 2 deletions(-)