From: Guenter Roeck <linux@roeck-us.net>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: linux-kernel@vger.kernel.org,
Jim Quinlan <james.quinlan@broadcom.com>,
linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: (scmi) handle absence of few types of sensors
Date: Tue, 10 Apr 2018 13:14:19 -0700 [thread overview]
Message-ID: <20180410201419.GA27759@roeck-us.net> (raw)
In-Reply-To: <1523028647-21849-1-git-send-email-sudeep.holla@arm.com>
On Fri, Apr 06, 2018 at 04:30:47PM +0100, Sudeep Holla wrote:
> Currently the loop checks for non-zero count of sensors for each type
> of sensors which is completely wrong. It also results in aborting the
> registration of sensors if one or more types of sensors are completely
> not supported by the platform SCMI firmware.
>
> This patch fixes the issue by continue to loop and skiping sensor types
> that are not present.
>
> Fixes: b23688aefb8b ("hwmon: add support for sensors exported via ARM SCMI")
> Reported-by: Jim Quinlan <james.quinlan@broadcom.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: linux-hwmon@vger.kernel.org
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Applied.
Thanks,
Guenter
> ---
> drivers/hwmon/scmi-hwmon.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/scmi-hwmon.c b/drivers/hwmon/scmi-hwmon.c
> index 363bf56eb0f2..91976b6ca300 100644
> --- a/drivers/hwmon/scmi-hwmon.c
> +++ b/drivers/hwmon/scmi-hwmon.c
> @@ -170,7 +170,10 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
> scmi_chip_info.info = ptr_scmi_ci;
> chip_info = &scmi_chip_info;
>
> - for (type = 0; type < hwmon_max && nr_count[type]; type++) {
> + for (type = 0; type < hwmon_max; type++) {
> + if (!nr_count[type])
> + continue;
> +
> scmi_hwmon_add_chan_info(scmi_hwmon_chan, dev, nr_count[type],
> type, hwmon_attributes[type]);
> *ptr_scmi_ci++ = scmi_hwmon_chan++;
> --
> 2.7.4
>
prev parent reply other threads:[~2018-04-10 20:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-06 15:30 Sudeep Holla
2018-04-10 20:14 ` Guenter Roeck [this message]
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=20180410201419.GA27759@roeck-us.net \
--to=linux@roeck-us.net \
--cc=james.quinlan@broadcom.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudeep.holla@arm.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
all inboxes | Powered by JetHome®