summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-08-01 17:05:09 +0530
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-08-23 16:49:18 +0200
commitc044179ea14db0855edc3d8f82bd998202167368 (patch)
tree9144d0d26fd779de4ee3dd04e118136a6f7c92b5
parent55bafbc277dcce7aab0ba28563075f3b517e6134 (diff)
downloadlinux-c044179ea14db0855edc3d8f82bd998202167368.tar.gz
linux-c044179ea14db0855edc3d8f82bd998202167368.tar.bz2
linux-c044179ea14db0855edc3d8f82bd998202167368.zip
mtd: nand: denali: 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@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
-rw-r--r--drivers/mtd/nand/denali_dt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index 47f398edf18f..56e2e177644d 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -118,7 +118,9 @@ static int denali_dt_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "no clk available\n");
return PTR_ERR(dt->clk);
}
- clk_prepare_enable(dt->clk);
+ ret = clk_prepare_enable(dt->clk);
+ if (ret)
+ return ret;
denali->clk_x_rate = clk_get_rate(dt->clk);