[PATCH staging] staging: et131x: fix invalid fail after the call to eeprom_wait_ready

Devendra Naga devendra.aaru at gmail.com
Tue Mar 12 05:34:45 UTC 2013


should be err < 0 instead of if (err) which actually the read register
value can be a positive number

Acked-by: Mark Einon <mark.einon at gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru at gmail.com>
---

Hello Greg,

This applies to staging-linus branch of yours.

Thanks,

 drivers/staging/et131x/et131x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 42ae5e8..c7e9e1d 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -595,7 +595,7 @@ static int eeprom_write(struct et131x_adapter *adapter, u32 addr, u8 data)
 	 */
 
 	err = eeprom_wait_ready(pdev, NULL);
-	if (err)
+	if (err < 0)
 		return err;
 
 	 /* 2. Write to the LBCIF Control Register:  bit 7=1, bit 6=1, bit 3=0,
@@ -709,7 +709,7 @@ static int eeprom_read(struct et131x_adapter *adapter, u32 addr, u8 *pdata)
 	 */
 
 	err = eeprom_wait_ready(pdev, NULL);
-	if (err)
+	if (err < 0)
 		return err;
 	/* Write to the LBCIF Control Register:  bit 7=1, bit 6=0, bit 3=0,
 	 * and bits 1:0 both =0.  Bit 5 should be set according to the type
-- 
1.8.1.2




More information about the devel mailing list