Skip to content

Commit 28607b4

Browse files
Uwe Kleine-Königmiquelraynal
authored andcommitted
mtd: st_spi_fsm: Add a clk_disable_unprepare() in .probe()'s error path
For all but one error path clk_disable_unprepare() is already there. Add it to the one location where it's missing. Fixes: 481815a ("mtd: st_spi_fsm: Handle clk_prepare_enable/clk_disable_unprepare.") Fixes: 69d5af8 ("mtd: st_spi_fsm: Obtain and use EMI clock") 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-2-u.kleine-koenig@pengutronix.de
1 parent 1cc82e0 commit 28607b4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/mtd/devices/st_spi_fsm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,10 +2115,12 @@ static int stfsm_probe(struct platform_device *pdev)
21152115
(long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20),
21162116
fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10));
21172117

2118-
return mtd_device_register(&fsm->mtd, NULL, 0);
2119-
2118+
ret = mtd_device_register(&fsm->mtd, NULL, 0);
2119+
if (ret) {
21202120
err_clk_unprepare:
2121-
clk_disable_unprepare(fsm->clk);
2121+
clk_disable_unprepare(fsm->clk);
2122+
}
2123+
21222124
return ret;
21232125
}
21242126

0 commit comments

Comments
 (0)