Skip to content

Commit cfa7847

Browse files
Uwe Kleine-Königmiquelraynal
authored andcommitted
mtd: st_spi_fsm: Warn about failure to unregister mtd device
mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow. This matches how other drivers (e.g. nand/raw/nandsim.c) use mtd_device_unregister(). By returning 0 in the platform remove callback a generic error message by the device core is suppressed, nothing else changes. 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/20220607152458.232847-3-u.kleine-koenig@pengutronix.de
1 parent 28607b4 commit cfa7847

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mtd/devices/st_spi_fsm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2130,7 +2130,9 @@ static int stfsm_remove(struct platform_device *pdev)
21302130

21312131
clk_disable_unprepare(fsm->clk);
21322132

2133-
return mtd_device_unregister(&fsm->mtd);
2133+
WARN_ON(mtd_device_unregister(&fsm->mtd));
2134+
2135+
return 0;
21342136
}
21352137

21362138
#ifdef CONFIG_PM_SLEEP

0 commit comments

Comments
 (0)