mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: "Rob Herring (Arm)" <robh@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: of: Match trip property helper types
Date: Mon, 15 Jun 2026 09:11:53 +0100	[thread overview]
Message-ID: <bc5e1109-473a-4c00-9578-8d468af8e2ca@arm.com> (raw)
In-Reply-To: <20260612215009.1884665-1-robh@kernel.org>



On 6/12/26 22:50, Rob Herring (Arm) wrote:
> The thermal-zone binding defines "temperature" as a signed int32
> value and "hysteresis" as an unsigned int32 value. Using helpers with
> matching types avoids dt_property_check mismatches and preserves the
> signed interpretation needed for trips below zero.
> 
> Read "temperature" with the signed helper and keep "hysteresis" on the
> unsigned helper using separate typed temporaries before storing them in
> the trip structure.
> 
> Assisted-by: Codex:gpt-5-5
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
>   drivers/thermal/thermal_of.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> index 99085c806a1f..196cb29afae9 100644
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
> @@ -63,22 +63,23 @@ static int thermal_of_get_trip_type(struct device_node *np,
>   static int thermal_of_populate_trip(struct device_node *np,
>   				    struct thermal_trip *trip)
>   {
> -	int prop;
> +	u32 hysteresis;
> +	s32 temperature;
>   	int ret;
>   
> -	ret = of_property_read_u32(np, "temperature", &prop);
> +	ret = of_property_read_s32(np, "temperature", &temperature);
>   	if (ret < 0) {
>   		pr_err("missing temperature property\n");
>   		return ret;
>   	}
> -	trip->temperature = prop;
> +	trip->temperature = temperature;
>   
> -	ret = of_property_read_u32(np, "hysteresis", &prop);
> +	ret = of_property_read_u32(np, "hysteresis", &hysteresis);
>   	if (ret < 0) {
>   		pr_err("missing hysteresis property\n");
>   		return ret;
>   	}
> -	trip->hysteresis = prop;
> +	trip->hysteresis = hysteresis;
>   
>   	ret = thermal_of_get_trip_type(np, &trip->type);
>   	if (ret < 0) {


Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

  reply	other threads:[~2026-06-15  8:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-12 21:50 Rob Herring (Arm)
2026-06-15  8:11 ` Lukasz Luba [this message]
2026-08-17 23:25 ` Rob Herring

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=bc5e1109-473a-4c00-9578-8d468af8e2ca@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh@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®