From: Guenter Roeck <linux@roeck-us.net>
To: Daniel Lezcano <daniel.lezcano@linaro.org>, rafael@kernel.org
Cc: michael@walle.cc, dan.carpenter@oracle.com,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH 2/4] thermal/of: Return -ENODEV instead of -EINVAL if registration fails
Date: Mon, 8 Aug 2022 11:35:34 -0700 [thread overview]
Message-ID: <f8008f05-4e4d-e21f-2e40-e234930ee86e@roeck-us.net> (raw)
In-Reply-To: <20220808180915.446053-2-daniel.lezcano@linaro.org>
On 8/8/22 11:09, Daniel Lezcano wrote:
> The previous version of the OF code was returning -ENODEV if no
> thermal zones description was found or if the lookup of the sensor in
> the thermal zones was not found.
>
> The backend drivers are expecting this return value as an information
> about skipping the sensor initialization and considered as normal.
>
> Fix the return value by replacing -EINVAL by -ENODEV
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> ---
> drivers/thermal/thermal_of.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> index 368eb58e97cf..4210c18ef7b2 100644
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
> @@ -329,7 +329,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int
> np = of_find_node_by_name(NULL, "thermal-zones");
> if (!np) {
> pr_err("Unable to find thermal zones description\n");
I really don't like that error message: People will see it (and complain)
whenever a sensor registers and there is no thermal zone, even though that
is perfectly normal (see description above).
Guenter
> - return ERR_PTR(-EINVAL);
> + return ERR_PTR(-ENODEV);
> }
>
> /*
> @@ -368,7 +368,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int
> }
> }
> }
> - tz = ERR_PTR(-EINVAL);
> + tz = ERR_PTR(-ENODEV);
> out:
> of_node_put(np);
> return tz;
next prev parent reply other threads:[~2022-08-08 18:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-08 18:09 [PATCH 1/4] thermal/of: Fix error code in of_thermal_zone_find() Daniel Lezcano
2022-08-08 18:09 ` [PATCH 2/4] thermal/of: Return -ENODEV instead of -EINVAL if registration fails Daniel Lezcano
2022-08-08 18:35 ` Guenter Roeck [this message]
2022-08-08 19:05 ` Michael Walle
2022-08-08 21:17 ` Daniel Lezcano
2022-08-08 20:31 ` Daniel Lezcano
2022-08-08 21:33 ` Guenter Roeck
2022-08-08 19:03 ` Michael Walle
2022-08-08 18:09 ` [PATCH 3/4] dt-bindings: thermal: Fix missing required property Daniel Lezcano
2022-08-08 18:09 ` [PATCH 4/4] thermal/of: Fix free after use in thermal_of_unregister() Daniel Lezcano
2022-08-08 18:44 ` Michael Walle
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=f8008f05-4e4d-e21f-2e40-e234930ee86e@roeck-us.net \
--to=linux@roeck-us.net \
--cc=amitk@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=michael@walle.cc \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.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®