Skip to content

Commit ddfab64

Browse files
groeckZhengShunQian
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 26eef56 commit ddfab64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hwmon/pmbus/adm1275.c

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

144-
if (page)
144+
if (page > 0)
145145
return -ENXIO;
146146

147147
switch (reg) {
@@ -218,7 +218,7 @@ static int adm1275_write_word_data(struct i2c_client *client, int page, int reg,
218218
const struct adm1275_data *data = to_adm1275_data(info);
219219
int ret;
220220

221-
if (page)
221+
if (page > 0)
222222
return -ENXIO;
223223

224224
switch (reg) {

0 commit comments

Comments
 (0)