[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <593294eb-aecd-2a9c-dc01-1e91b0a00075@roeck-us.net>
Date: Mon, 8 Aug 2022 14:33:00 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Daniel Lezcano <daniel.lezcano@...aro.org>, rafael@...nel.org
Cc: michael@...le.cc, dan.carpenter@...cle.com,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
Amit Kucheria <amitk@...nel.org>,
Zhang Rui <rui.zhang@...el.com>
Subject: Re: [PATCH 2/4] thermal/of: Return -ENODEV instead of -EINVAL if
registration fails
On 8/8/22 13:31, Daniel Lezcano wrote:
> On 08/08/2022 20:35, Guenter Roeck wrote:
>> 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@...aro.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).
>>
>
> I agree, I'll change the message to:
>
> pr_info("No thermal zones description\n");
>
> sounds good ?
>
I think it should be silent or at best pr_debug.
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;
>>
>
>
Powered by blists - more mailing lists