diff options
author | 2010-12-31 04:57:46 +0000 | |
---|---|---|
committer | 2011-01-21 14:08:34 +1100 | |
commit | f32be0c54057faac90e0b5e9e13fa9f8fab127ac (patch) | |
tree | 4dc3e6c16b97dc79a0fc1b570cdf8394f75d001a /drivers/macintosh/therm_pm72.c | |
parent | powerpc/rtas_flash: Use simple_read_from_buffer (diff) | |
download | linux-f32be0c54057faac90e0b5e9e13fa9f8fab127ac.tar.gz linux-f32be0c54057faac90e0b5e9e13fa9f8fab127ac.tar.bz2 linux-f32be0c54057faac90e0b5e9e13fa9f8fab127ac.zip |
powerpc/macintosh: Fix wrong test in fan_{read,write}_reg()
Fix error test in fan_{read,write}_reg()
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/macintosh/therm_pm72.c')
-rw-r--r-- | drivers/macintosh/therm_pm72.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index 2e041fd0a00c..f3a29f264db9 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c @@ -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; @@ -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; |