All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: Use dev_err_probe() for direct probe errors
@ 2026-12-05 17:31 Sumeet Pawnikar
  0 siblings, 0 replies; only message in thread
From: Sumeet Pawnikar @ 2026-12-05 17:31 UTC (permalink / raw)
  To: rafael, daniel.lezcano, hayashi.kunihiko, mhiramat, linux-pm
  Cc: linux-kernel, sumeet4linux

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-05 17:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 17:31 [PATCH] thermal: Use dev_err_probe() for direct probe errors Sumeet Pawnikar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.