Skip to content

Commit

Permalink
mtd: nand: orion: Handle return value of clk_prepare_enable
Browse files Browse the repository at this point in the history
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
  • Loading branch information
Arvind Yadav authored and Boris Brezillon committed Jun 10, 2017
1 parent d45e531 commit 3762a33
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/mtd/nand/orion_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ static int __init orion_nand_probe(struct platform_device *pdev)
}
}

clk_prepare_enable(info->clk);
ret = clk_prepare_enable(info->clk);
if (ret) {
dev_err(&pdev->dev, "failed to prepare clock!\n");
return ret;
}

ret = nand_scan(mtd, 1);
if (ret)
Expand Down

0 comments on commit 3762a33

Please sign in to comment.