Skip to content

Commit

Permalink
staging: et131x: fix invalid fail after the call to eeprom_wait_ready
Browse files Browse the repository at this point in the history
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@gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Devendra Naga authored and Greg Kroah-Hartman committed Mar 12, 2013
1 parent f165d81 commit 8dd4a96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/et131x/et131x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8dd4a96

Please sign in to comment.