]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
regulator: lp3971 - remove unnecessary ret value checking in lp3971_i2c_write()
authorAxel Lin <axel.lin@gmail.com>
Mon, 9 Aug 2010 09:01:21 +0000 (17:01 +0800)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Wed, 11 Aug 2010 10:38:02 +0000 (11:38 +0100)
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>
drivers/regulator/lp3971.c

index 5362289c7d69d3cb12a6e0a43f9f1e0c7951f8ef..3bb82b624e19f9cafb230a1a29ac3f0ce13514dc 100644 (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)