Commit ecb29abd authored by Guenter Roeck's avatar Guenter Roeck

hwmon: (pmbus/adm1275) Accept negative page register values

A negative page register value means that no page needs to be
selected. This is used by status register read operations and needs
to be accepted. The failure to do so so results in missed status
and limit registers.

Fixes: da8e48ab ("hwmon: (pmbus) Always call _pmbus_read_byte in core driver")
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent a46f8cd6
......@@ -154,7 +154,7 @@ static int adm1275_read_word_data(struct i2c_client *client, int page, int reg)
const struct adm1275_data *data = to_adm1275_data(info);
int ret = 0;
if (page)
if (page > 0)
return -ENXIO;
switch (reg) {
......@@ -240,7 +240,7 @@ static int adm1275_write_word_data(struct i2c_client *client, int page, int reg,
const struct adm1275_data *data = to_adm1275_data(info);
int ret;
if (page)
if (page > 0)
return -ENXIO;
switch (reg) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment