diff options
author | David Brownell <david-b@pacbell.net> | 2008-07-14 16:38:25 -0400 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-07-14 16:38:25 -0400 |
commit | 97140342e69d479a3ad82bfd4c154c0b08fe3eea (patch) | |
tree | 2ee2ad225c7e4850a30bc57c4bf07251c1da1085 /drivers/i2c/busses/i2c-amd756-s4882.c | |
parent | 6ea438ec8da4ec56bf415f5ea360e6b0cb59c6c3 (diff) |
i2c: Bus drivers return -Errno not -1
Tighten error paths used by various i2c adapters (mostly x86) so
they return real fault/errno codes instead of a "-1" (which is
most often interpreted as "-EPERM"). Build tested, with eyeball
review.
One minor initial goal is to have adapters consistently return
the code "-ENXIO" when addressing a device doesn't get an ACK
response, at least in the probe paths where they are already
good at stifling related logspam.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-amd756-s4882.c')
-rw-r--r-- | drivers/i2c/busses/i2c-amd756-s4882.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-amd756-s4882.c b/drivers/i2c/busses/i2c-amd756-s4882.c index c38a0a112208..2f150e33c74c 100644 --- a/drivers/i2c/busses/i2c-amd756-s4882.c +++ b/drivers/i2c/busses/i2c-amd756-s4882.c | |||
@@ -58,7 +58,7 @@ static s32 amd756_access_virt0(struct i2c_adapter * adap, u16 addr, | |||
58 | /* We exclude the multiplexed addresses */ | 58 | /* We exclude the multiplexed addresses */ |
59 | if (addr == 0x4c || (addr & 0xfc) == 0x50 || (addr & 0xfc) == 0x30 | 59 | if (addr == 0x4c || (addr & 0xfc) == 0x50 || (addr & 0xfc) == 0x30 |
60 | || addr == 0x18) | 60 | || addr == 0x18) |
61 | return -1; | 61 | return -ENXIO; |
62 | 62 | ||
63 | mutex_lock(&amd756_lock); | 63 | mutex_lock(&amd756_lock); |
64 | 64 | ||
@@ -86,7 +86,7 @@ static inline s32 amd756_access_channel(struct i2c_adapter * adap, u16 addr, | |||
86 | 86 | ||
87 | /* We exclude the non-multiplexed addresses */ | 87 | /* We exclude the non-multiplexed addresses */ |
88 | if (addr != 0x4c && (addr & 0xfc) != 0x50 && (addr & 0xfc) != 0x30) | 88 | if (addr != 0x4c && (addr & 0xfc) != 0x50 && (addr & 0xfc) != 0x30) |
89 | return -1; | 89 | return -ENXIO; |
90 | 90 | ||
91 | mutex_lock(&amd756_lock); | 91 | mutex_lock(&amd756_lock); |
92 | 92 | ||