From: Gopi Krishna Menon <krishnagopi487@gmail.com>
To: rafael@kernel.org, daniel.lezcano@kernel.org,
rui.zhang@intel.com, lukasz.luba@arm.com
Cc: Gopi Krishna Menon <krishnagopi487@gmail.com>,
daniel.baluta@nxp.com, simona.toaca@nxp.com, d-gole@ti.com,
m-chawdhry@ti.com, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2] thermal: fix error condition for reading st,thermal-flags
Date: Fri, 27 Mar 2026 14:35:24 +0530 [thread overview]
Message-ID: <20260327090526.59330-1-krishnagopi487@gmail.com> (raw)
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
Fixes: b9c7aff481f1 ("drivers/thermal/spear_thermal.c: add Device Tree probing capability")
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Suggested-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Gopi Krishna Menon <krishnagopi487@gmail.com>
---
Changes since v1:
- Add Fixes and Reviewed-by tags
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.53.0
next reply other threads:[~2026-03-27 9:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 9:05 Gopi Krishna Menon [this message]
2026-03-27 10:27 ` [PATCH v2] thermal: fix error condition for reading st,thermal-flags Daniel Lezcano
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=20260327090526.59330-1-krishnagopi487@gmail.com \
--to=krishnagopi487@gmail.com \
--cc=d-gole@ti.com \
--cc=daniel.baluta@nxp.com \
--cc=daniel.lezcano@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=m-chawdhry@ti.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=simona.toaca@nxp.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