From: Sumeet Pawnikar <sumeet4linux@gmail.com>
To: rafael@kernel.org, daniel.lezcano@kernel.org,
hayashi.kunihiko@socionext.com, mhiramat@kernel.org,
linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, sumeet4linux@gmail.com
Subject: [PATCH] thermal: Use dev_err_probe() for direct probe errors
Date: Sat, 5 Dec 2026 23:01:50 +0530 [thread overview]
Message-ID: <20261205173151.725935-1-sumeet4linux@gmail.com> (raw)
Replace the open-coded dev_err() and PTR_ERR() return sequences in
the thermal MMIO and UniPhier probe paths with dev_err_probe().
This preserves the original probe error while providing standardized
symbolic error logging and deferred-probe handling.
No functional change intended.
Signed-off-by: Sumeet Pawnikar <sumeet4linux@gmail.com>
---
drivers/thermal/thermal_mmio.c | 9 +++------
drivers/thermal/uniphier_thermal.c | 8 +++-----
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/thermal/thermal_mmio.c b/drivers/thermal/thermal_mmio.c
index 201b70b6be58..dcecdd27ded8 100644
--- a/drivers/thermal/thermal_mmio.c
+++ b/drivers/thermal/thermal_mmio.c
@@ -69,12 +69,9 @@ static int thermal_mmio_probe(struct platform_device *pdev)
0,
sensor,
&thermal_mmio_ops);
- if (IS_ERR(thermal_zone)) {
- dev_err(&pdev->dev,
- "failed to register sensor (%ld)\n",
- PTR_ERR(thermal_zone));
- return PTR_ERR(thermal_zone);
- }
+ if (IS_ERR(thermal_zone))
+ return dev_err_probe(&pdev->dev, PTR_ERR(thermal_zone),
+ "failed to register sensor\n");
thermal_mmio_get_temperature(thermal_zone, &temperature);
dev_info(&pdev->dev,
diff --git a/drivers/thermal/uniphier_thermal.c b/drivers/thermal/uniphier_thermal.c
index be4474729b59..43b5ba5606de 100644
--- a/drivers/thermal/uniphier_thermal.c
+++ b/drivers/thermal/uniphier_thermal.c
@@ -285,11 +285,9 @@ static int uniphier_tm_probe(struct platform_device *pdev)
parent = of_get_parent(dev->of_node); /* parent should be syscon node */
regmap = syscon_node_to_regmap(parent);
of_node_put(parent);
- if (IS_ERR(regmap)) {
- dev_err(dev, "failed to get regmap (error %ld)\n",
- PTR_ERR(regmap));
- return PTR_ERR(regmap);
- }
+ if (IS_ERR(regmap))
+ return dev_err_probe(dev, PTR_ERR(regmap),
+ "failed to get regmap\n");
tdev->regmap = regmap;
ret = uniphier_tm_initialize_sensor(tdev);
--
2.53.0
reply other threads:[~2026-12-05 17:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261205173151.725935-1-sumeet4linux@gmail.com \
--to=sumeet4linux@gmail.com \
--cc=daniel.lezcano@kernel.org \
--cc=hayashi.kunihiko@socionext.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=rafael@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