]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
BugLink: http://bugs.launchpad.net/bugs/1786352
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hwmon/pmbus/max8688.c

index dd4883a19045601fcccac2cebea02d987a728e02..e951f9b87abb0cd4caeb854bd0936f6175657e30 100644 (file)
@@ -45,7 +45,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) {