i2c: emev2: Handle return value of clk_prepare_enable
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 24 May 2017 14:01:06 +0000 (19:31 +0530)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 19 Jun 2017 20:18:55 +0000 (22:18 +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: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-emev2.c

index 3129127088542728e2f2e73993a956f2d589800a..d2e84480fbe96093549666df92a55f4f7196259f 100644 (file)
@@ -375,7 +375,9 @@ static int em_i2c_probe(struct platform_device *pdev)
        if (IS_ERR(priv->sclk))
                return PTR_ERR(priv->sclk);
 
-       clk_prepare_enable(priv->sclk);
+       ret = clk_prepare_enable(priv->sclk);
+       if (ret)
+               return ret;
 
        priv->adap.timeout = msecs_to_jiffies(100);
        priv->adap.retries = 5;