diff mbox series

[v2] hwmon: pmbus: pxe1610: don't bail out when not all pages are active

Message ID 20210416102926.13614-1-fercerpav@gmail.com (mailing list archive)
State Accepted
Headers show
Series [v2] hwmon: pmbus: pxe1610: don't bail out when not all pages are active | expand

Commit Message

Paul Fertser April 16, 2021, 10:29 a.m. UTC
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>
---

Notes:
    Changes for v2:
      - Use more imperative style

 drivers/hwmon/pmbus/pxe1610.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Guenter Roeck April 16, 2021, 2:14 p.m. UTC | #1
On Fri, Apr 16, 2021 at 01:29:04PM +0300, Paul Fertser wrote:
> 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>

Applied.

Thanks,
Guenter

> ---
> 
> Notes:
>     Changes for v2:
>       - Use more imperative style
> 
>  drivers/hwmon/pmbus/pxe1610.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> 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;
>  			}
>  		}
> -- 
> 2.20.1
>
diff mbox series

Patch

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;
 			}
 		}