From: Arvind Yadav Date: Thu, 1 Jun 2017 10:58:15 +0000 (+0530) Subject: mtd: nand: orion: Handle return value of clk_prepare_enable X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3762a33b007b63e058eb600eccf0bcd097d386f5;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Boris Brezillon --- diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index f8e463a97b9e..209170ed2b76 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)