Skip to content

Commit

Permalink
i2c: emev2: Handle return value of clk_prepare_enable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arvind Yadav authored and Wolfram Sang committed Jun 19, 2017
1 parent 04606cc commit f646221
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/i2c/busses/i2c-emev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f646221

Please sign in to comment.