diff options
author | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-07-29 22:19:39 -0700 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-10-24 11:09:40 -0700 |
commit | da8e48ab483e1f54c1099bed91bfd2c302bc7ddf (patch) | |
tree | 10a2c76781ef0b1c51515d4feb71c7fa5ae6e29f /drivers/hwmon/pmbus/adm1275.c | |
parent | 179144a0d4128e7588b3d613a14807402f5e7c37 (diff) | |
download | talos-obmc-linux-da8e48ab483e1f54c1099bed91bfd2c302bc7ddf.tar.gz talos-obmc-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/adm1275.c')
-rw-r--r-- | drivers/hwmon/pmbus/adm1275.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c index fa1811274c27..980a4d9d5028 100644 --- a/drivers/hwmon/pmbus/adm1275.c +++ b/drivers/hwmon/pmbus/adm1275.c @@ -144,7 +144,7 @@ static int adm1275_read_byte_data(struct i2c_client *client, int page, int reg) const struct adm1275_data *data = to_adm1275_data(info); int mfr_status, ret; - if (page) + if (page > 0) return -ENXIO; switch (reg) { |