From: Axel Lin Date: Mon, 9 Aug 2010 09:01:21 +0000 (+0800) Subject: regulator: lp3971 - remove unnecessary ret value checking in lp3971_i2c_write() X-Git-Tag: v2.6.36-rc1~58^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1bddc2f5c1727577183761581d5d4d1b00a8bd63;p=karo-tx-linux.git 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 Acked-by: Mark Brown Signed-off-by: Liam Girdwood --- diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c index 5362289c7d69..3bb82b624e19 100644 --- a/drivers/regulator/lp3971.c +++ b/drivers/regulator/lp3971.c @@ -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)