Commit c9a2c46d authored by Jean Delvare's avatar Jean Delvare Committed by Jean Delvare

ARM: OMAP: Release i2c_adapter after use (Siemens SX1)

Each call to i2c_get_adapter() must be followed by a call to
i2c_put_adapter() to release the grabbed reference. Otherwise the
reference count grows forever and the adapter can never be
unregistered.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Acked-by: default avatarVladimir Ananiev <vovan888@gmail.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
parent 4fa2b1cd
...@@ -61,6 +61,7 @@ int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) ...@@ -61,6 +61,7 @@ int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value)
data[0] = regoffset; /* register num */ data[0] = regoffset; /* register num */
data[1] = value; /* register data */ data[1] = value; /* register data */
err = i2c_transfer(adap, msg, 1); err = i2c_transfer(adap, msg, 1);
i2c_put_adapter(adap);
if (err >= 0) if (err >= 0)
return 0; return 0;
return err; return err;
...@@ -91,6 +92,7 @@ int sx1_i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value) ...@@ -91,6 +92,7 @@ int sx1_i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value)
msg->buf = data; msg->buf = data;
err = i2c_transfer(adap, msg, 1); err = i2c_transfer(adap, msg, 1);
*value = data[0]; *value = data[0];
i2c_put_adapter(adap);
if (err >= 0) if (err >= 0)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment