Skip to content

Commit

Permalink
hwmon: (pmbus/adm1275) Accept negative page register values
Browse files Browse the repository at this point in the history
[ Upstream commit ecb29ab ]

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: da8e48a ("hwmon: (pmbus) Always call _pmbus_read_byte in core driver")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
groeck authored and gregkh committed May 30, 2018
1 parent 68f70a8 commit 67fa456
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hwmon/pmbus/adm1275.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,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) {
Expand Down Expand Up @@ -144,7 +144,7 @@ static int adm1275_write_word_data(struct i2c_client *client, int page, int reg,
{
int ret;

if (page)
if (page > 0)
return -ENXIO;

switch (reg) {
Expand Down

0 comments on commit 67fa456

Please sign in to comment.