Skip to content

Commit a5a8812

Browse files
Yi Yangmiquelraynal
authored andcommitted
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: e25da1c ("mtd: fsmc_nand: Add clk_{un}prepare() support") Signed-off-by: Yi Yang <yiyang13@huawei.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230817115839.10192-1-yiyang13@huawei.com
1 parent f504551 commit a5a8812

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/mtd/nand/raw/fsmc_nand.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,9 +1200,14 @@ static int fsmc_nand_suspend(struct device *dev)
12001200
static int fsmc_nand_resume(struct device *dev)
12011201
{
12021202
struct fsmc_nand_data *host = dev_get_drvdata(dev);
1203+
int ret;
12031204

12041205
if (host) {
1205-
clk_prepare_enable(host->clk);
1206+
ret = clk_prepare_enable(host->clk);
1207+
if (ret) {
1208+
dev_err(dev, "failed to enable clk\n");
1209+
return ret;
1210+
}
12061211
if (host->dev_timings)
12071212
fsmc_nand_setup(host, host->dev_timings);
12081213
nand_reset(&host->nand, 0);

0 commit comments

Comments
 (0)