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>
这个提交包含在:
Guenter Roeck
2011-07-29 22:19:39 -07:00
父节点 179144a0d4
当前提交 da8e48ab48
修改 6 个文件,包含 17 行新增15 行删除

查看文件

@@ -93,12 +93,14 @@ static int max34440_write_word_data(struct i2c_client *client, int page,
static int max34440_read_byte_data(struct i2c_client *client, int page, int reg)
{
int ret;
int ret = 0;
int mfg_status;
ret = pmbus_set_page(client, page);
if (ret < 0)
return ret;
if (page >= 0) {
ret = pmbus_set_page(client, page);
if (ret < 0)
return ret;
}
switch (reg) {
case PMBUS_STATUS_IOUT: