From: Arvind Yadav Date: Wed, 31 May 2017 10:25:54 +0000 (+0530) Subject: memory: ti-aemif: Handle return value of clk_prepare_enable X-Git-Tag: v4.13-rc1~181^2~103 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=761d031ec95b09f4126748a4849b3dabe3c00427;p=karo-tx-linux.git memory: ti-aemif: 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: Greg Kroah-Hartman --- diff --git a/drivers/memory/ti-aemif.c b/drivers/memory/ti-aemif.c index 22c1aeeb6421..2744b1b91b57 100644 --- a/drivers/memory/ti-aemif.c +++ b/drivers/memory/ti-aemif.c @@ -357,7 +357,10 @@ static int aemif_probe(struct platform_device *pdev) return PTR_ERR(aemif->clk); } - clk_prepare_enable(aemif->clk); + ret = clk_prepare_enable(aemif->clk); + if (ret) + return ret; + aemif->clk_rate = clk_get_rate(aemif->clk) / MSEC_PER_SEC; if (of_device_is_compatible(np, "ti,da850-aemif"))