diff options
author | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-09-01 17:34:31 +0200 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-10-24 20:09:39 +0200 |
commit | 179144a0d4128e7588b3d613a14807402f5e7c37 (patch) | |
tree | 996869256838ba759495d1a1331ffcddba94b1bd /drivers/hwmon/pmbus/lm25066.c | |
parent | hwmon: (pmbus) Provide more documentation (diff) | |
download | linux-179144a0d4128e7588b3d613a14807402f5e7c37.tar.xz linux-179144a0d4128e7588b3d613a14807402f5e7c37.zip |
hwmon: (pmbus) Replace EINVAL return codes with more appropriate errors
EINVAL was over-used in the code. Replace it with more appropriate errors.
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Diffstat (limited to 'drivers/hwmon/pmbus/lm25066.c')
-rw-r--r-- | drivers/hwmon/pmbus/lm25066.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c index 2107f413e4fc..a72bb9f51dec 100644 --- a/drivers/hwmon/pmbus/lm25066.c +++ b/drivers/hwmon/pmbus/lm25066.c @@ -57,7 +57,7 @@ static int lm25066_read_word_data(struct i2c_client *client, int page, int reg) int ret; if (page > 1) - return -EINVAL; + return -ENXIO; /* Map READ_VAUX into READ_VOUT register on page 1 */ if (page == 1) { @@ -85,7 +85,7 @@ static int lm25066_read_word_data(struct i2c_client *client, int page, int reg) break; default: /* No other valid registers on page 1 */ - ret = -EINVAL; + ret = -ENXIO; break; } goto done; @@ -138,7 +138,7 @@ static int lm25066_write_word_data(struct i2c_client *client, int page, int reg, int ret; if (page > 1) - return -EINVAL; + return -ENXIO; switch (reg) { case PMBUS_IIN_OC_WARN_LIMIT: @@ -164,7 +164,7 @@ static int lm25066_write_word_data(struct i2c_client *client, int page, int reg, static int lm25066_write_byte(struct i2c_client *client, int page, u8 value) { if (page > 1) - return -EINVAL; + return -ENXIO; if (page == 0) return pmbus_write_byte(client, 0, value); |