summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/pmbus/lm25066.c
diff options
context:
space:
mode:
authorGuenter Roeck <guenter.roeck@ericsson.com>2011-07-30 07:19:39 +0200
committerGuenter Roeck <guenter.roeck@ericsson.com>2011-10-24 20:09:40 +0200
commitda8e48ab483e1f54c1099bed91bfd2c302bc7ddf (patch)
tree10a2c76781ef0b1c51515d4feb71c7fa5ae6e29f /drivers/hwmon/pmbus/lm25066.c
parenthwmon: (pmbus) Replace EINVAL return codes with more appropriate errors (diff)
downloadlinux-da8e48ab483e1f54c1099bed91bfd2c302bc7ddf.tar.xz
linux-da8e48ab483e1f54c1099bed91bfd2c302bc7ddf.zip
hwmon: (pmbus) Always call _pmbus_read_byte in core driver
Always call _pmbus_read_byte() instead of pmbus_read_byte() in PMBus core driver. With this change, device specific read functions can be implemented for all registers. Since the device specific read_byte function is now always called, we need to be more careful with page validations. Only fail if the passed page number is larger than 0, since -1 means "current page". 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c
index a72bb9f51dec..84a37f0c8db6 100644
--- a/drivers/hwmon/pmbus/lm25066.c
+++ b/drivers/hwmon/pmbus/lm25066.c
@@ -166,8 +166,8 @@ static int lm25066_write_byte(struct i2c_client *client, int page, u8 value)
if (page > 1)
return -ENXIO;
- if (page == 0)
- return pmbus_write_byte(client, 0, value);
+ if (page <= 0)
+ return pmbus_write_byte(client, page, value);
return 0;
}