2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-20 16:46:23 +08:00

regulator: lp3971 - remove unnecessary ret value checking in lp3971_i2c_write()

i2c_smbus_write_byte_data() returns zero or negative value,
therefore no need to check if ret is greater than zero or not.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
Axel Lin 2010-08-09 17:01:21 +08:00 committed by Liam Girdwood
parent 53a4befa4e
commit 1bddc2f5c1

View File

@ -387,15 +387,9 @@ static int lp3971_i2c_read(struct i2c_client *i2c, char reg, int count,
static int lp3971_i2c_write(struct i2c_client *i2c, char reg, int count,
const u16 *src)
{
int ret;
if (count != 1)
return -EIO;
ret = i2c_smbus_write_byte_data(i2c, reg, *src);
if (ret >= 0)
return 0;
return ret;
return i2c_smbus_write_byte_data(i2c, reg, *src);
}
static u8 lp3971_reg_read(struct lp3971 *lp3971, u8 reg)