mtd: nand: orion: Handle return value of clk_prepare_enable
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Thu Jul 13 10:59:17 PDT 2017
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=3762a33b007b63e058eb600eccf0bcd097d386f5
Commit: 3762a33b007b63e058eb600eccf0bcd097d386f5
Parent: d45e5316e6a5071dbfe44bae04a89a3ba75e1ea9
Author: Arvind Yadav <arvind.yadav.cs at gmail.com>
AuthorDate: Thu Jun 1 16:28:15 2017 +0530
Committer: Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Sat Jun 10 12:09:27 2017 +0200
mtd: nand: orion: Handle return value of clk_prepare_enable
clk_prepare_enable() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs at gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
drivers/mtd/nand/orion_nand.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index f8e463a..209170e 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -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)
More information about the linux-mtd-cvs
mailing list