linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Paul Fertser <fercerpav@gmail.com>, linux-hwmon@vger.kernel.org
Cc: Jean Delvare <jdelvare@suse.com>,
	Vadim Pasternak <vadimp@mellanox.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: pmbus: pxe1610: don't bail out when not all pages are active
Date: Thu, 15 Apr 2021 08:18:57 -0700	[thread overview]
Message-ID: <3612b78a-8e43-289b-ff0f-6c995995eeb0@roeck-us.net> (raw)
In-Reply-To: <20210415133535.11171-1-fercerpav@gmail.com>

On 4/15/21 6:34 AM, 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>
> ---
>  drivers/hwmon/pmbus/pxe1610.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/pmbus/pxe1610.c b/drivers/hwmon/pmbus/pxe1610.c
> index 517584cff3de..ff6f6e05923b 100644
> --- a/drivers/hwmon/pmbus/pxe1610.c
> +++ b/drivers/hwmon/pmbus/pxe1610.c
> @@ -41,7 +41,16 @@ static int pxe1610_identify(struct i2c_client *client,
>  				info->vrm_version[i] = vr13;
>  				break;
>  			default:
> -				return -ENODEV;
> +				/*
> +				 * If prior pages are available limit operation
> +				 * to them
> +				 */
> +				if (i != 0) {
> +					info->pages = i;
> +					return 0;
> +				} else {
> +					return -ENODEV;
> +				}

else after return is unnecessary.

Thanks,
Guenter

  reply	other threads:[~2021-04-15 15:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 13:34 [PATCH] hwmon: pmbus: pxe1610: don't bail out when not all pages are active Paul Fertser
2021-04-15 15:18 ` Guenter Roeck [this message]
2021-04-16 10:29   ` [PATCH v2] " Paul Fertser
2021-04-16 14:14     ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3612b78a-8e43-289b-ff0f-6c995995eeb0@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=fercerpav@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vadimp@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).