From: Erik Rosen <erik.rosen@metormote.com>
To: Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
Jonathan Corbet <corbet@lwn.net>,
Daniel Nilsson <daniel.nilsson@flex.com>,
linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Erik Rosen <erik.rosen@metormote.com>
Subject: [PATCH v4 3/5] hwmon: (pmbus/pim4328) Allow phase function even if it's not on page
Date: Tue, 1 Jun 2021 18:43:18 +0200 [thread overview]
Message-ID: <20210601164320.2907-4-erik.rosen@metormote.com> (raw)
In-Reply-To: <20210601164320.2907-1-erik.rosen@metormote.com>
Allow the use of a phase function even if it does not exist not on
the associated page.
Signed-off-by: Erik Rosen <erik.rosen@metormote.com>
---
drivers/hwmon/pmbus/pmbus_core.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index cd80cb574267..7c4f7b6c846e 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -1327,14 +1327,14 @@ static int pmbus_add_sensor_attrs(struct i2c_client *client,
pages = paged ? info->pages : 1;
for (page = 0; page < pages; page++) {
- if (!(info->func[page] & attrs->func))
- continue;
- ret = pmbus_add_sensor_attrs_one(client, data, info,
- name, index, page,
- 0xff, attrs, paged);
- if (ret)
- return ret;
- index++;
+ if (info->func[page] & attrs->func) {
+ ret = pmbus_add_sensor_attrs_one(client, data, info,
+ name, index, page,
+ 0xff, attrs, paged);
+ if (ret)
+ return ret;
+ index++;
+ }
if (info->phases[page]) {
int phase;
--
2.20.1
next prev parent reply other threads:[~2021-06-01 16:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 16:43 [PATCH v4 0/6] hwmon: (pmbus/pim4328) Add pim4328 PMBus driver Erik Rosen
2021-06-01 16:43 ` [PATCH v4 1/5] hwmon: (pmbus/pim4328) Add new pmbus flag NO_WRITE_PROTECT Erik Rosen
2021-06-02 12:12 ` Guenter Roeck
2021-06-01 16:43 ` [PATCH v4 2/5] hwmon: (pmbus/pim4328) Add support for reading direct mode coefficients Erik Rosen
2021-06-02 12:15 ` Guenter Roeck
2021-06-01 16:43 ` Erik Rosen [this message]
2021-06-02 12:10 ` [PATCH v4 3/5] hwmon: (pmbus/pim4328) Allow phase function even if it's not on page Guenter Roeck
2021-06-01 16:43 ` [PATCH v4 4/5] hwmon: (pmbus/pim4328) Add PMBus driver for PIM4006, PIM4328 and PIM4820 Erik Rosen
2021-06-02 12:16 ` Guenter Roeck
2021-06-01 16:43 ` [PATCH v4 5/5] hwmon: (pmbus/pim4328) Add documentation for the pim4328 PMBus driver Erik Rosen
2021-06-02 8:51 ` Daniel Nilsson
2021-06-02 10:56 ` 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=20210601164320.2907-4-erik.rosen@metormote.com \
--to=erik.rosen@metormote.com \
--cc=corbet@lwn.net \
--cc=daniel.nilsson@flex.com \
--cc=jdelvare@suse.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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).