Skip to content

Commit 67fa456

Browse files
groeckgregkh
authored andcommitted
hwmon: (pmbus/adm1275) Accept negative page register values
[ 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>
1 parent 68f70a8 commit 67fa456

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/hwmon/pmbus/adm1275.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int adm1275_read_word_data(struct i2c_client *client, int page, int reg)
6767
const struct adm1275_data *data = to_adm1275_data(info);
6868
int ret = 0;
6969

70-
if (page)
70+
if (page > 0)
7171
return -ENXIO;
7272

7373
switch (reg) {
@@ -144,7 +144,7 @@ static int adm1275_write_word_data(struct i2c_client *client, int page, int reg,
144144
{
145145
int ret;
146146

147-
if (page)
147+
if (page > 0)
148148
return -ENXIO;
149149

150150
switch (reg) {

0 commit comments

Comments
 (0)