summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2022-06-07 17:24:57 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2022-06-09 15:06:36 +0200
commitcd043c613e21bb6f039057043da759471706adf5 (patch)
tree04711fe488f908e44fd858e751a0e62ac2103eb4 /drivers/mtd
parentcfa7847f150c4343903d8ff2cd219418c1768205 (diff)
downloadlinux-cd043c613e21bb6f039057043da759471706adf5.tar.gz
linux-cd043c613e21bb6f039057043da759471706adf5.tar.bz2
linux-cd043c613e21bb6f039057043da759471706adf5.zip
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: 1fefc8ecb834 ("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
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/devices/st_spi_fsm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index a5a4b612480c..9f6d4dd8bade 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -2128,10 +2128,10 @@ static int stfsm_remove(struct platform_device *pdev)
{
struct stfsm *fsm = platform_get_drvdata(pdev);
- clk_disable_unprepare(fsm->clk);
-
WARN_ON(mtd_device_unregister(&fsm->mtd));
+ clk_disable_unprepare(fsm->clk);
+
return 0;
}