diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-12-04 20:21:37 -0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2013-12-12 22:48:22 +0100 |
commit | e5bf216a945e7292f8718276372d2b41486bed26 (patch) | |
tree | 69d106bf305787fe3aa7c9cbf70347f54c6fe1a3 /drivers/i2c/busses/i2c-imx.c | |
parent | 2212a8529eb06c559256f0cee41c1f14890d54d3 (diff) | |
download | talos-obmc-linux-e5bf216a945e7292f8718276372d2b41486bed26.tar.gz talos-obmc-linux-e5bf216a945e7292f8718276372d2b41486bed26.zip |
i2c: imx: Check the return value from clk_prepare_enable()
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>
Diffstat (limited to 'drivers/i2c/busses/i2c-imx.c')
-rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 1d7efa3169cd..d0cfbb4cb964 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -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); |