]> git.hungrycats.org Git - linux/commitdiff
hwmon: (pmbus/max8688) Accept negative page register values
authorGuenter Roeck <linux@roeck-us.net>
Sun, 11 Mar 2018 01:49:47 +0000 (17:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:47:42 +0000 (07:47 +0200)
[ Upstream commit a46f8cd696624ef757be0311eb28f119c36778e8 ]

A negative page register value means that no page needs to be
selected. This is used by status register evaluations and needs
to be accepted.

Fixes: da8e48ab483e1 ("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>
drivers/hwmon/pmbus/max8688.c

index f04454a42fdd2ec68395535ae3553e86e849bc3e..893df4dffae4207a15140e6321adae7a50021233 100644 (file)
@@ -44,7 +44,7 @@ static int max8688_read_word_data(struct i2c_client *client, int page, int reg)
 {
        int ret;
 
-       if (page)
+       if (page > 0)
                return -ENXIO;
 
        switch (reg) {