Skip to contentSkip to conversation

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

PATCH RESEND Superseded Axel Lin 2 participants 3 messages Aug 6, 2010 – Aug 9, 2010 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH RESEND 1/2 regulator: lp3971 - remove unnecessary ret value checking in lp3971_i2c_write()

We already check count value before calling i2c_smbus_read_byte_data(), no need to check it again.

---
This resend adds regulator: prefix in the subject line.

 drivers/regulator/lp3971.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/lp3971.c +1 -1
index d4d9822..3bb82b6 100644
@@ -377,7 +377,7 @@ static int lp3971_i2c_read(struct i2c_client *i2c, char reg, int count,
 	if (count != 1)
 		return -EIO;
 	ret = i2c_smbus_read_byte_data(i2c, reg);
-	if (ret < 0 || count != 1)
+	if (ret < 0)
 		return -EIO;
 
 	*dest = ret;
Signature · 1 line
1.5.4.3
#1 lore raw
Quoted 16 lines · Axel Lin

We already check count value before calling i2c_smbus_read_byte_data(), no need to check it again.

---
This resend adds regulator: prefix in the subject line.

 drivers/regulator/lp3971.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/lp3971.c +0 -0
index d4d9822..3bb82b6 100644

drivers/regulator/lp3971.c static int lp3971_i2c_read(struct i2c_client *i2c, char reg, int count, · line 383

Quoted 8 lines
drivers/regulator/lp3971.c +1 -1
@@ -377,7 +377,7 @@ static int lp3971_i2c_read(struct i2c_client *i2c, char reg, int count,
 	if (count != 1)
 		return -EIO;
 	ret = i2c_smbus_read_byte_data(i2c, reg);
-	if (ret < 0 || count != 1)
+	if (ret < 0)
 		return -EIO;
 
 	*dest = ret;

Applied 1/2 only as 2/2 is the same patch.

Thanks

Liam

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
author
#2 lore raw

2010/8/9 Liam Girdwood <[email protected]>:

Quoted 24 lines · Axel Lin
Quoted 23 lines

We already check count value before calling i2c_smbus_read_byte_data(), no need to check it again.

---
This resend adds regulator: prefix in the subject line.

 drivers/regulator/lp3971.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/lp3971.c +1 -1
index d4d9822..3bb82b6 100644
@@ -377,7 +377,7 @@ static int lp3971_i2c_read(struct i2c_client *i2c, char reg, int count,
       if (count != 1)
               return -EIO;
       ret = i2c_smbus_read_byte_data(i2c, reg);
-     if (ret < 0 || count != 1)
+     if (ret < 0)
               return -EIO;
 
Quoted 3 lines

drivers/regulator/lp3971.c static int lp3971_i2c_read(struct i2c_client *i2c, char reg, int count, · line 383

Quoted 1 line
drivers/regulator/lp3971.c +0 -0
       *dest = ret;

Applied 1/2 only as 2/2 is the same patch.

Ooops. My bad. I copied the same patch for patch 1/2 and 1/2. I'll resend it now.
patch tiltle: [PATCH RESEND again] regulator: lp3971 - remove unnecessary ret value checking in lp3971_i2c_write()

Regards,
Axel