Commit a5a88125 authored by Yi Yang's avatar Yi Yang Committed by Miquel Raynal

mtd: rawnand: fsmc: handle clk prepare error in fsmc_nand_resume()

In fsmc_nand_resume(), the return value of clk_prepare_enable() should be
checked since it might fail.

Fixes: e25da1c0 ("mtd: fsmc_nand: Add clk_{un}prepare() support")
Signed-off-by: default avatarYi Yang <yiyang13@huawei.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230817115839.10192-1-yiyang13@huawei.com
parent f504551b
...@@ -1200,9 +1200,14 @@ static int fsmc_nand_suspend(struct device *dev) ...@@ -1200,9 +1200,14 @@ static int fsmc_nand_suspend(struct device *dev)
static int fsmc_nand_resume(struct device *dev) static int fsmc_nand_resume(struct device *dev)
{ {
struct fsmc_nand_data *host = dev_get_drvdata(dev); struct fsmc_nand_data *host = dev_get_drvdata(dev);
int ret;
if (host) { if (host) {
clk_prepare_enable(host->clk); ret = clk_prepare_enable(host->clk);
if (ret) {
dev_err(dev, "failed to enable clk\n");
return ret;
}
if (host->dev_timings) if (host->dev_timings)
fsmc_nand_setup(host, host->dev_timings); fsmc_nand_setup(host, host->dev_timings);
nand_reset(&host->nand, 0); nand_reset(&host->nand, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment