Skip to content

Commit 413948c

Browse files
Uwe Kleine-Königmiquelraynal
authored andcommitted
mtd: rawnand: tegra: Don't skip cleanup after mtd_device_unregister() failed
If mtd_device_unregister() fails (which it doesn't when used correctly), the resources bound by the nand chip should be freed anyhow as returning an error value doesn't prevent the device getting unbound. Instead use WARN_ON on the return value similar to how other drivers do it. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220603210758.148493-11-u.kleine-koenig@pengutronix.de
1 parent 37e0024 commit 413948c

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/mtd/nand/raw/tegra_nand.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,11 +1223,8 @@ static int tegra_nand_remove(struct platform_device *pdev)
12231223
struct tegra_nand_controller *ctrl = platform_get_drvdata(pdev);
12241224
struct nand_chip *chip = ctrl->chip;
12251225
struct mtd_info *mtd = nand_to_mtd(chip);
1226-
int ret;
12271226

1228-
ret = mtd_device_unregister(mtd);
1229-
if (ret)
1230-
return ret;
1227+
WARN_ON(mtd_device_unregister(mtd));
12311228

12321229
nand_cleanup(chip);
12331230

0 commit comments

Comments
 (0)