Skip to content

Commit

Permalink
mtd: st_spi_fsm: Add a clk_disable_unprepare() in .probe()'s error path
Browse files Browse the repository at this point in the history
[ Upstream commit 28607b4 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Uwe Kleine-König authored and gregkh committed Aug 17, 2022
1 parent 7624754 commit c99dca4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/mtd/devices/st_spi_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2115,10 +2115,12 @@ static int stfsm_probe(struct platform_device *pdev)
(long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20),
fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10));

return mtd_device_register(&fsm->mtd, NULL, 0);

ret = mtd_device_register(&fsm->mtd, NULL, 0);
if (ret) {
err_clk_unprepare:
clk_disable_unprepare(fsm->clk);
clk_disable_unprepare(fsm->clk);
}

return ret;
}

Expand Down

0 comments on commit c99dca4

Please sign in to comment.