From: Arvind Yadav Date: Wed, 24 May 2017 14:01:06 +0000 (+0530) Subject: i2c: emev2: Handle return value of clk_prepare_enable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f64622167f4aa5124fed264d481509829d34e126;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git i2c: emev2: 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: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-emev2.c b/drivers/i2c/busses/i2c-emev2.c index 312912708854..d2e84480fbe9 100644 --- a/drivers/i2c/busses/i2c-emev2.c +++ b/drivers/i2c/busses/i2c-emev2.c @@ -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;