Skip to content

Commit

Permalink
i2c: imx: Check the return value from clk_prepare_enable()
Browse files Browse the repository at this point in the history
clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Fabio Estevam authored and Wolfram Sang committed Dec 12, 2013
1 parent 2212a85 commit e5bf216
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/i2c/busses/i2c-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ static int i2c_imx_start(struct imx_i2c_struct *i2c_imx)

dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);

clk_prepare_enable(i2c_imx->clk);
result = clk_prepare_enable(i2c_imx->clk);
if (result)
return result;
imx_i2c_write_reg(i2c_imx->ifdr, i2c_imx, IMX_I2C_IFDR);
/* Enable I2C controller */
imx_i2c_write_reg(i2c_imx->hwdata->i2sr_clr_opcode, i2c_imx, IMX_I2C_I2SR);
Expand Down

0 comments on commit e5bf216

Please sign in to comment.