Skip to content

Commit 1cc82e0

Browse files
Uwe Kleine-Königmiquelraynal
authored andcommitted
mtd: rawnand: atmel: Warn about failure to unregister mtd device
The Linux device core doesn't intend remove callbacks to fail. If an error code is returned the device is removed anyhow. So wail loudly if the atmel specific remove callback fails and return 0 anyhow to suppress the generic (and little helpful) error message by the device core. 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/20220607062503.211345-1-u.kleine-koenig@pengutronix.de
1 parent f88c97c commit 1cc82e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mtd/nand/raw/atmel/nand-controller.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2629,7 +2629,9 @@ static int atmel_nand_controller_remove(struct platform_device *pdev)
26292629
{
26302630
struct atmel_nand_controller *nc = platform_get_drvdata(pdev);
26312631

2632-
return nc->caps->ops->remove(nc);
2632+
WARN_ON(nc->caps->ops->remove(nc));
2633+
2634+
return 0;
26332635
}
26342636

26352637
static __maybe_unused int atmel_nand_controller_resume(struct device *dev)

0 commit comments

Comments
 (0)