Skip to content

Commit

Permalink
powerpc/macintosh: Fix wrong test in fan_{read,write}_reg()
Browse files Browse the repository at this point in the history
Fix error test in fan_{read,write}_reg()

Signed-off-by: Roel Kluin <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
  • Loading branch information
RoelKluin authored and ozbenh committed Jan 21, 2011
1 parent 4c4a5cf commit f32be0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/macintosh/therm_pm72.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ static int fan_read_reg(int reg, unsigned char *buf, int nb)
tries = 0;
for (;;) {
nr = i2c_master_recv(fcu, buf, nb);
if (nr > 0 || (nr < 0 && nr != ENODEV) || tries >= 100)
if (nr > 0 || (nr < 0 && nr != -ENODEV) || tries >= 100)
break;
msleep(10);
++tries;
Expand All @@ -464,7 +464,7 @@ static int fan_write_reg(int reg, const unsigned char *ptr, int nb)
tries = 0;
for (;;) {
nw = i2c_master_send(fcu, buf, nb);
if (nw > 0 || (nw < 0 && nw != EIO) || tries >= 100)
if (nw > 0 || (nw < 0 && nw != -EIO) || tries >= 100)
break;
msleep(10);
++tries;
Expand Down

0 comments on commit f32be0c

Please sign in to comment.