From: Guenter Roeck <linux@roeck-us.net>
To: Flaviu Nistor <flaviu.nistor@gmail.com>
Cc: Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] hwmon: (lm90) Switch channel parsing to fwnode APIs
Date: Mon, 20 Jul 2026 07:15:42 -0700 [thread overview]
Message-ID: <fe0ee4ea-0b47-4ea0-9586-b06555a74e78@roeck-us.net> (raw)
In-Reply-To: <20260720135550.10654-1-flaviu.nistor@gmail.com>
On 7/20/26 06:55, Flaviu Nistor wrote:
> On Fri, Jul 19, 2026 at 17:06:00, Guenter Roeck wrote:
>> On Fri, Jul 17, 2026 at 09:37:30AM +0300, Flaviu Nistor wrote:
>>> Replace OF property handling with fwnode in the probe function to read
>>> the channels properties, improving the driver compatibility since this
>>> method is not limited to Device Tree only.
>>> Add also the needed headers for explicit include and clean up related
>>> function naming.
>>>
>>> Signed-off-by: Flaviu Nistor <flaviu.nistor@gmail.com>
>>> ---
>>> Changes in v2:
>>> - Remove <linux/mod_devicetable.h> as suggested by Uwe Kleine-Konig.
>>> - Link to v1: https://lore.kernel.org/all/20260713190659.4511-1-flaviu.nistor@gmail.com/
>>>
>>> drivers/hwmon/lm90.c | 47 +++++++++++++++++++++-----------------------
>>> 1 file changed, 22 insertions(+), 25 deletions(-)
>>>
>>> diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
>>>
>> ...
>>
>>> - err = of_property_read_s32(child, "temperature-offset-millicelsius", &val);
>>> + err = fwnode_property_read_u32(child, "temperature-offset-millicelsius", &val);
>>
>> I understand you consider it to be irrelevant, but temperature offsets can
>> be negative. Please explain how this is handled.
>>
>
> It is no about the fact that I consider it irrelevant, but rather I was mislead
> that of_property_read_s32 maps to of_property_read_u32(), and the new fwnode API
> does not have a dedicated function for signed values.
> I see as a solution to add a similar approach to include/linux/property.h. Add a new
> fwnode_property_read_s32 that maps to fwnode_property_read_u32, and then use it in the driver.
> I will try to send a new patch series to have a working solution.
>
Type casting in the driver and adding a comment explaining the reason would be
perfectly fine. What is not ok is to silently ignore it. Also, it will need
to be tested if it is working as intended. For of_property_read_s32() we can
assume that it works since there is an API function. That is not the case
for the fwnode API, which either means that the fwnode API does not support
negative properties or that no one needed and/or tested it.
Guenter
next prev parent reply other threads:[~2026-07-20 14:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 6:37 Flaviu Nistor
2026-07-19 14:06 ` Guenter Roeck
2026-07-20 13:55 ` Flaviu Nistor
2026-07-20 14:15 ` Guenter Roeck [this message]
[not found] <20260717064947.824201F000E9@smtp.kernel.org>
2026-07-17 7:06 ` Flaviu Nistor
2026-07-17 8:00 ` Flaviu Nistor
2026-07-17 16:18 ` 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=fe0ee4ea-0b47-4ea0-9586-b06555a74e78@roeck-us.net \
--to=linux@roeck-us.net \
--cc=flaviu.nistor@gmail.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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®