Skip to content

Commit cd043c6

Browse files
Uwe Kleine-Königmiquelraynal
authored andcommitted
mtd: st_spi_fsm: Disable clock only after device was unregistered
Until mtd_device_unregister() returns the device is expected to be operational. So only disable the clock after the mtd is unregistered. Fixes: 1fefc8e ("mtd: st_spi_fsm: add missing clk_disable_unprepare() in stfsm_remove()") 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-4-u.kleine-koenig@pengutronix.de
1 parent cfa7847 commit cd043c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mtd/devices/st_spi_fsm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,10 +2128,10 @@ static int stfsm_remove(struct platform_device *pdev)
21282128
{
21292129
struct stfsm *fsm = platform_get_drvdata(pdev);
21302130

2131-
clk_disable_unprepare(fsm->clk);
2132-
21332131
WARN_ON(mtd_device_unregister(&fsm->mtd));
21342132

2133+
clk_disable_unprepare(fsm->clk);
2134+
21352135
return 0;
21362136
}
21372137

0 commit comments

Comments
 (0)