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: Jean Delvare <khali@linux-fr.org>
Acked-by: Vladimir Ananiev <vovan888@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
data[0] = regoffset; /* register num */
data[1] = value; /* register data */
err = i2c_transfer(adap, msg, 1);
+ i2c_put_adapter(adap);
if (err >= 0)
return 0;
return err;
msg->buf = data;
err = i2c_transfer(adap, msg, 1);
*value = data[0];
+ i2c_put_adapter(adap);
if (err >= 0)
return 0;