* [PATCH] thermal: fix error condition for reading st,thermal-flags
@ 2026-03-25 8:18 Gopi Krishna Menon
2026-03-26 9:06 ` Lukasz Luba
0 siblings, 1 reply; 2+ messages in thread
From: Gopi Krishna Menon @ 2026-03-25 8:18 UTC (permalink / raw)
To: rafael, daniel.lezcano, rui.zhang, lukasz.luba
Cc: Gopi Krishna Menon, daniel.baluta, simona.toaca, d-gole,
m-chawdhry, linux-pm, linux-kernel
of_property_read_u32 returns 0 on success. The current check returns
-EINVAL if the property is read successfully.
Fix the check by removing ! from of_property_read_u32
Suggested-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Gopi Krishna Menon <krishnagopi487@gmail.com>
---
Note:
* This patch is part of the GSoC2026 application process for device tree bindings conversions
* https://github.com/LinuxFoundationGSoC/ProjectIdeas/wiki/GSoC-2026-Device-Tree-Bindings
* Changes have only been compile tested
drivers/thermal/spear_thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
index 603dadcd3df5..5e3e9c1f32f8 100644
--- a/drivers/thermal/spear_thermal.c
+++ b/drivers/thermal/spear_thermal.c
@@ -93,7 +93,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
int ret = 0, val;
- if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
+ if (!np || of_property_read_u32(np, "st,thermal-flags", &val)) {
dev_err(&pdev->dev, "Failed: DT Pdata not passed\n");
return -EINVAL;
}
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] thermal: fix error condition for reading st,thermal-flags
2026-03-25 8:18 [PATCH] thermal: fix error condition for reading st,thermal-flags Gopi Krishna Menon
@ 2026-03-26 9:06 ` Lukasz Luba
0 siblings, 0 replies; 2+ messages in thread
From: Lukasz Luba @ 2026-03-26 9:06 UTC (permalink / raw)
To: Gopi Krishna Menon, rafael, daniel.lezcano, rui.zhang
Cc: daniel.baluta, simona.toaca, d-gole, m-chawdhry, linux-pm,
linux-kernel
On 3/25/26 08:18, Gopi Krishna Menon wrote:
> of_property_read_u32 returns 0 on success. The current check returns
> -EINVAL if the property is read successfully.
>
> Fix the check by removing ! from of_property_read_u32
>
> Suggested-by: Daniel Baluta <daniel.baluta@nxp.com>
> Signed-off-by: Gopi Krishna Menon <krishnagopi487@gmail.com>
> ---
> Note:
> * This patch is part of the GSoC2026 application process for device tree bindings conversions
> * https://github.com/LinuxFoundationGSoC/ProjectIdeas/wiki/GSoC-2026-Device-Tree-Bindings
> * Changes have only been compile tested
>
> drivers/thermal/spear_thermal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
> index 603dadcd3df5..5e3e9c1f32f8 100644
> --- a/drivers/thermal/spear_thermal.c
> +++ b/drivers/thermal/spear_thermal.c
> @@ -93,7 +93,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
> struct device_node *np = pdev->dev.of_node;
> int ret = 0, val;
>
> - if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
> + if (!np || of_property_read_u32(np, "st,thermal-flags", &val)) {
> dev_err(&pdev->dev, "Failed: DT Pdata not passed\n");
> return -EINVAL;
> }
Good catch. It deserves the fixes tag, please find the commit
which introduced that. With adding that fixes info, feel free to
add:
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-26 9:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-25 8:18 [PATCH] thermal: fix error condition for reading st,thermal-flags Gopi Krishna Menon
2026-03-26 9:06 ` Lukasz Luba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox