diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-02-25 15:13:13 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-02-27 08:55:55 +0100 |
commit | 9dd62d274e2cca72ffa4acde782f91e934263cfe (patch) | |
tree | 0138a46e448dd52a3083a409fa8bab06bb9a900d /drivers/i2c | |
parent | 8bba223a64fa1e314107350892b2bf2b8220b0e1 (diff) | |
download | barebox-9dd62d274e2cca72ffa4acde782f91e934263cfe.tar.gz barebox-9dd62d274e2cca72ffa4acde782f91e934263cfe.tar.xz |
i2c: i.MX: move disabling of controller out of i2c_fsl_stop
Move disabling of the controller out of i2c_fsl_stop(). This makes the
function reusable in other places in the next patch.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 72d9fe5845..74f080dfc9 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -345,10 +345,6 @@ static void i2c_fsl_stop(struct i2c_adapter *adapter) i2c_fsl_bus_busy(adapter, 0); i2c_fsl->stopped = 1; } - - /* Disable I2C controller, and force our state to stopped */ - temp = i2c_fsl->hwdata->i2cr_ien_opcode ^ I2CR_IEN, - fsl_i2c_write_reg(temp, i2c_fsl, FSL_I2C_I2CR); } #ifdef CONFIG_PPC @@ -609,6 +605,10 @@ fail0: /* Stop I2C transfer */ i2c_fsl_stop(adapter); + /* Disable I2C controller, and force our state to stopped */ + temp = i2c_fsl->hwdata->i2cr_ien_opcode ^ I2CR_IEN, + fsl_i2c_write_reg(temp, i2c_fsl, FSL_I2C_I2CR); + return (result < 0) ? result : num; } |