Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Flaviu Nistor <flaviu.nistor@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>,
	Flaviu Nistor <flaviu.nistor@gmail.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 16:55:50 +0300	[thread overview]
Message-ID: <20260720135550.10654-1-flaviu.nistor@gmail.com> (raw)
In-Reply-To: <edb03ab2-1211-4bdd-b4f1-21f80065ef6a@roeck-us.net>

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.

Thanks and best regards,
Flaviu

>Thanks,
>Guenter



  reply	other threads:[~2026-07-20 13:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17  6:37 [PATCH v2] hwmon: (lm90) Switch channel parsing to fwnode APIs Flaviu Nistor
2026-07-17  6:49 ` sashiko-bot
2026-07-17  7:06   ` Flaviu Nistor
2026-07-17  8:00     ` Flaviu Nistor
2026-07-17 16:18       ` Guenter Roeck
2026-07-19 14:06 ` Guenter Roeck
2026-07-20 13:55   ` Flaviu Nistor [this message]
2026-07-20 14:15     ` 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=20260720135550.10654-1-flaviu.nistor@gmail.com \
    --to=flaviu.nistor@gmail.com \
    --cc=jdelvare@suse.com \
    --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