mtd: nand: orion: Handle return value of clk_prepare_enable
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Thu, 1 Jun 2017 10:58:15 +0000 (16:28 +0530)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Sat, 10 Jun 2017 10:09:27 +0000 (12:09 +0200)
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>
drivers/mtd/nand/orion_nand.c

index f8e463a97b9ee479028dd9c282ff74436d885389..209170ed2b764511d6224ab8ddb8996059c26663 100644 (file)
@@ -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)