summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2021-04-16 13:29:04 +0300
committerGuenter Roeck <linux@roeck-us.net>2021-04-20 06:50:14 -0700
commitf025314306ae17a3fdaf2874d7e878ce19cea363 (patch)
tree4d6ef60956a0722cb32bf2b4f3a4a92870ca414b /drivers/hwmon
parent1734b4135a62fd2402232346b809e99177ea6b4c (diff)
hwmon: (pmbus/pxe1610) don't bail out when not all pages are active
Certain VRs might be configured to use only the first output channel and so the mode for the second will be 0. Handle this gracefully. Fixes: b9fa0a3acfd8 ("hwmon: (pmbus/core) Add support for vid mode detection per page bases") Signed-off-by: Paul Fertser <fercerpav@gmail.com> Link: https://lore.kernel.org/r/20210416102926.13614-1-fercerpav@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/pmbus/pxe1610.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/pxe1610.c b/drivers/hwmon/pmbus/pxe1610.c
index da27ce34ee3f..eb4a06003b7f 100644
--- a/drivers/hwmon/pmbus/pxe1610.c
+++ b/drivers/hwmon/pmbus/pxe1610.c
@@ -41,6 +41,15 @@ static int pxe1610_identify(struct i2c_client *client,
info->vrm_version[i] = vr13;
break;
default:
+ /*
+ * If prior pages are available limit operation
+ * to them
+ */
+ if (i != 0) {
+ info->pages = i;
+ return 0;
+ }
+
return -ENODEV;
}
}