public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register()
@ 2025-09-05  7:23 Xichao Zhao
  2025-09-05  7:23 ` [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register() Xichao Zhao
                   ` (11 more replies)
  0 siblings, 12 replies; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:23 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

Add dev_err_probe() in devm_thermal_of_zone_register() to unify
error reporting. Remove redundant error log prints in various driver codes.

Xichao Zhao (12):
  thermal: of: Add error handling in devm_thermal_*_register()
  hwmon: Remove redundant error log prints
  iio: adc: Remove redundant error log prints
  regulator: max8973: Remove redundant error log prints
  thermal: Remove redundant error log prints
  thermal: broadcom: Remove redundant error log prints
  thermal: qcom: Remove redundant error log prints
  thermal: renesas: Remove redundant error log prints
  thermal: samsung: Remove redundant error log prints
  thermal: st: Remove redundant error log prints
  thermal: tegra: Remove redundant error log prints
  thermal: ti-soc-thermal: Remove redundant error log  prints

 drivers/hwmon/hwmon.c                              |  3 +--
 drivers/iio/adc/sun4i-gpadc-iio.c                  |  6 +-----
 drivers/regulator/max8973-regulator.c              |  8 ++------
 drivers/thermal/airoha_thermal.c                   |  4 +---
 drivers/thermal/amlogic_thermal.c                  |  7 ++-----
 drivers/thermal/armada_thermal.c                   |  2 --
 drivers/thermal/broadcom/bcm2711_thermal.c         |  7 ++-----
 drivers/thermal/broadcom/bcm2835_thermal.c         |  2 +-
 drivers/thermal/broadcom/brcmstb_thermal.c         |  3 +--
 drivers/thermal/db8500_thermal.c                   |  5 ++---
 drivers/thermal/hisi_thermal.c                     |  7 +------
 drivers/thermal/imx8mm_thermal.c                   |  3 ---
 drivers/thermal/imx_sc_thermal.c                   |  2 +-
 drivers/thermal/k3_bandgap.c                       |  1 -
 drivers/thermal/k3_j72xx_bandgap.c                 |  1 -
 drivers/thermal/loongson2_thermal.c                |  2 +-
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c           |  7 +------
 drivers/thermal/qcom/qcom-spmi-temp-alarm.c        |  3 +--
 drivers/thermal/renesas/rcar_gen3_thermal.c        |  1 -
 drivers/thermal/renesas/rcar_thermal.c             |  3 ++-
 drivers/thermal/renesas/rzg2l_thermal.c            |  1 -
 drivers/thermal/rockchip_thermal.c                 |  8 ++------
 drivers/thermal/samsung/exynos_tmu.c               |  2 +-
 drivers/thermal/sprd_thermal.c                     |  2 --
 drivers/thermal/st/st_thermal.c                    |  1 -
 drivers/thermal/st/stm_thermal.c                   |  8 ++------
 drivers/thermal/tegra/soctherm.c                   |  2 --
 drivers/thermal/tegra/tegra30-tsensor.c            |  3 +--
 drivers/thermal/thermal-generic-adc.c              | 10 ++--------
 drivers/thermal/thermal_mmio.c                     |  6 +-----
 drivers/thermal/thermal_of.c                       |  6 +++++-
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c |  4 +---
 drivers/thermal/uniphier_thermal.c                 |  4 +---
 33 files changed, 36 insertions(+), 98 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register()
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
@ 2025-09-05  7:23 ` Xichao Zhao
  2025-09-05  7:56   ` Niklas Söderlund
                     ` (2 more replies)
  2025-09-05  7:23 ` [PATCH 02/12] hwmon: Remove redundant error log prints Xichao Zhao
                   ` (10 subsequent siblings)
  11 siblings, 3 replies; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:23 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() does not print any error message
when registering a thermal zone with a device node sensor fails
and allocating device resource data fails.

This forces each driver to implement redundant error logging.
Additionally, when upper-layer functions propagate these errors
without logging, critical debugging information is lost.

Add dev_err_probe() in devm_thermal_of_zone_register() to unify
error reporting.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/thermal/thermal_of.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 1a51a4d240ff..8fe0ad402579 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -475,11 +475,15 @@ struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, in
 
 	ptr = devres_alloc(devm_thermal_of_zone_release, sizeof(*ptr),
 			   GFP_KERNEL);
-	if (!ptr)
+	if (!ptr) {
+		dev_err(dev, "Failed to allocate device resource data\n");
 		return ERR_PTR(-ENOMEM);
+	}
 
 	tzd = thermal_of_zone_register(dev->of_node, sensor_id, data, ops);
 	if (IS_ERR(tzd)) {
+		dev_err_probe(dev, PTR_ERR(tzd),
+			      "Failed to register thermal zone sensor[%d]\n", sensor_id);
 		devres_free(ptr);
 		return tzd;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 02/12] hwmon: Remove redundant error log prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
  2025-09-05  7:23 ` [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register() Xichao Zhao
@ 2025-09-05  7:23 ` Xichao Zhao
  2025-09-05 14:31   ` Guenter Roeck
  2025-09-05  7:23 ` [PATCH 03/12] iio: adc: " Xichao Zhao
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:23 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/hwmon/hwmon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
index 1688c210888a..0514e4bc5e71 100644
--- a/drivers/hwmon/hwmon.c
+++ b/drivers/hwmon/hwmon.c
@@ -239,8 +239,7 @@ static int hwmon_thermal_add_sensor(struct device *dev, int index)
 	if (IS_ERR(tzd)) {
 		if (PTR_ERR(tzd) != -ENODEV)
 			return PTR_ERR(tzd);
-		dev_info(dev, "temp%d_input not attached to any thermal zone\n",
-			 index + 1);
+
 		devm_kfree(dev, tdata);
 		return 0;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 03/12] iio: adc: Remove redundant error log prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
  2025-09-05  7:23 ` [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register() Xichao Zhao
  2025-09-05  7:23 ` [PATCH 02/12] hwmon: Remove redundant error log prints Xichao Zhao
@ 2025-09-05  7:23 ` Xichao Zhao
  2025-09-05  7:37   ` Chen-Yu Tsai
  2025-09-05  7:23 ` [PATCH 04/12] regulator: max8973: " Xichao Zhao
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:23 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/iio/adc/sun4i-gpadc-iio.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
index 6b8d6bee1873..3b33480813fe 100644
--- a/drivers/iio/adc/sun4i-gpadc-iio.c
+++ b/drivers/iio/adc/sun4i-gpadc-iio.c
@@ -640,12 +640,8 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
 		 * Do not fail driver probing when failing to register in
 		 * thermal because no thermal DT node is found.
 		 */
-		if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV) {
-			dev_err(&pdev->dev,
-				"could not register thermal sensor: %ld\n",
-				PTR_ERR(info->tzd));
+		if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV)
 			return PTR_ERR(info->tzd);
-		}
 	}
 
 	ret = devm_iio_device_register(&pdev->dev, indio_dev);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 04/12] regulator: max8973: Remove redundant error log prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
                   ` (2 preceding siblings ...)
  2025-09-05  7:23 ` [PATCH 03/12] iio: adc: " Xichao Zhao
@ 2025-09-05  7:23 ` Xichao Zhao
  2025-09-05 10:42   ` Mark Brown
  2025-09-05  7:23 ` [PATCH 05/12] thermal: " Xichao Zhao
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:23 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/regulator/max8973-regulator.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
index f68caa07f546..9853a7a5850b 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -478,12 +478,8 @@ static int max8973_thermal_init(struct max8973_chip *mchip)
 
 	tzd = devm_thermal_of_zone_register(mchip->dev, 0, mchip,
 					    &max77621_tz_ops);
-	if (IS_ERR(tzd)) {
-		ret = PTR_ERR(tzd);
-		dev_err(mchip->dev, "Failed to register thermal sensor: %d\n",
-			ret);
-		return ret;
-	}
+	if (IS_ERR(tzd))
+		return PTR_ERR(tzd);
 
 	if (mchip->irq <= 0)
 		return 0;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 05/12] thermal: Remove redundant error log prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
                   ` (3 preceding siblings ...)
  2025-09-05  7:23 ` [PATCH 04/12] regulator: max8973: " Xichao Zhao
@ 2025-09-05  7:23 ` Xichao Zhao
  2025-09-05  7:23 ` [PATCH 06/12] thermal: broadcom: " Xichao Zhao
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:23 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/thermal/airoha_thermal.c      |  4 +---
 drivers/thermal/amlogic_thermal.c     |  7 ++-----
 drivers/thermal/armada_thermal.c      |  2 --
 drivers/thermal/db8500_thermal.c      |  5 ++---
 drivers/thermal/hisi_thermal.c        |  7 +------
 drivers/thermal/imx8mm_thermal.c      |  3 ---
 drivers/thermal/imx_sc_thermal.c      |  2 +-
 drivers/thermal/k3_bandgap.c          |  1 -
 drivers/thermal/k3_j72xx_bandgap.c    |  1 -
 drivers/thermal/loongson2_thermal.c   |  2 +-
 drivers/thermal/rockchip_thermal.c    |  8 ++------
 drivers/thermal/sprd_thermal.c        |  2 --
 drivers/thermal/thermal-generic-adc.c | 10 ++--------
 drivers/thermal/thermal_mmio.c        |  6 +-----
 drivers/thermal/uniphier_thermal.c    |  4 +---
 15 files changed, 14 insertions(+), 50 deletions(-)

diff --git a/drivers/thermal/airoha_thermal.c b/drivers/thermal/airoha_thermal.c
index b9fd6bfc88e5..1994b62df04b 100644
--- a/drivers/thermal/airoha_thermal.c
+++ b/drivers/thermal/airoha_thermal.c
@@ -454,10 +454,8 @@ static int airoha_thermal_probe(struct platform_device *pdev)
 
 	/* register of thermal sensor and get info from DT */
 	priv->tz = devm_thermal_of_zone_register(dev, 0, priv, &thdev_ops);
-	if (IS_ERR(priv->tz)) {
-		dev_err(dev, "register thermal zone sensor failed\n");
+	if (IS_ERR(priv->tz))
 		return PTR_ERR(priv->tz);
-	}
 
 	platform_set_drvdata(pdev, priv);
 
diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index 5448d772db12..03f806248df1 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -282,11 +282,8 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
 						   0,
 						   pdata,
 						   &amlogic_thermal_ops);
-	if (IS_ERR(pdata->tzd)) {
-		ret = PTR_ERR(pdata->tzd);
-		dev_err(dev, "Failed to register tsensor: %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(pdata->tzd))
+		return PTR_ERR(pdata->tzd);
 
 	devm_thermal_add_hwmon_sysfs(&pdev->dev, pdata->tzd);
 
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index c2fbdb534f61..22145b6cb2d9 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -938,8 +938,6 @@ static int armada_thermal_probe(struct platform_device *pdev)
 						   sensor->id, sensor,
 						   &of_ops);
 		if (IS_ERR(tz)) {
-			dev_info(&pdev->dev, "Thermal sensor %d unavailable\n",
-				 sensor_id);
 			devm_kfree(&pdev->dev, sensor);
 			continue;
 		}
diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c
index 576f88b6a1b3..891a4ed639f0 100644
--- a/drivers/thermal/db8500_thermal.c
+++ b/drivers/thermal/db8500_thermal.c
@@ -186,10 +186,9 @@ static int db8500_thermal_probe(struct platform_device *pdev)
 
 	/* register of thermal sensor and get info from DT */
 	th->tz = devm_thermal_of_zone_register(dev, 0, th, &thdev_ops);
-	if (IS_ERR(th->tz)) {
-		dev_err(dev, "register thermal zone sensor failed\n");
+	if (IS_ERR(th->tz))
 		return PTR_ERR(th->tz);
-	}
+
 	dev_info(dev, "thermal zone sensor registered\n");
 
 	/* Start measuring at the lowest point */
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
index 4307161533a7..30181ac8cf47 100644
--- a/drivers/thermal/hisi_thermal.c
+++ b/drivers/thermal/hisi_thermal.c
@@ -480,17 +480,12 @@ static int hisi_trip_walk_cb(struct thermal_trip *trip, void *arg)
 static int hisi_thermal_register_sensor(struct platform_device *pdev,
 					struct hisi_thermal_sensor *sensor)
 {
-	int ret;
-
 	sensor->tzd = devm_thermal_of_zone_register(&pdev->dev,
 						    sensor->id, sensor,
 						    &hisi_of_thermal_ops);
 	if (IS_ERR(sensor->tzd)) {
-		ret = PTR_ERR(sensor->tzd);
 		sensor->tzd = NULL;
-		dev_err(&pdev->dev, "failed to register sensor id %d: %d\n",
-			sensor->id, ret);
-		return ret;
+		return PTR_ERR(sensor->tzd);
 	}
 
 	thermal_zone_for_each_trip(sensor->tzd, hisi_trip_walk_cb, sensor);
diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c
index 719d71f5b235..0776b7b0675f 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -333,9 +333,6 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
 						      &tmu_tz_ops);
 		if (IS_ERR(tmu->sensors[i].tzd)) {
 			ret = PTR_ERR(tmu->sensors[i].tzd);
-			dev_err(&pdev->dev,
-				"failed to register thermal zone sensor[%d]: %d\n",
-				i, ret);
 			goto disable_clk;
 		}
 		tmu->sensors[i].hw_id = i;
diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c
index 88558ce58880..6a36e5f54a51 100644
--- a/drivers/thermal/imx_sc_thermal.c
+++ b/drivers/thermal/imx_sc_thermal.c
@@ -111,7 +111,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)
 			if (ret == -ENODEV)
 				continue;
 
-			return dev_err_probe(&pdev->dev, ret, "failed to register thermal zone\n");
+			return ret;
 		}
 
 		devm_thermal_add_hwmon_sysfs(&pdev->dev, sensor->tzd);
diff --git a/drivers/thermal/k3_bandgap.c b/drivers/thermal/k3_bandgap.c
index 678d6ed711b5..4cd61e916ff7 100644
--- a/drivers/thermal/k3_bandgap.c
+++ b/drivers/thermal/k3_bandgap.c
@@ -216,7 +216,6 @@ static int k3_bandgap_probe(struct platform_device *pdev)
 					      &data[id],
 					      &k3_of_thermal_ops);
 		if (IS_ERR(data[id].tzd)) {
-			dev_err(dev, "thermal zone device is NULL\n");
 			ret = PTR_ERR(data[id].tzd);
 			goto err_alloc;
 		}
diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c
index a36289e61315..fabb42fa6df7 100644
--- a/drivers/thermal/k3_j72xx_bandgap.c
+++ b/drivers/thermal/k3_j72xx_bandgap.c
@@ -509,7 +509,6 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
 		ti_thermal = devm_thermal_of_zone_register(bgp->dev, id, &data[id],
 							   &k3_of_thermal_ops);
 		if (IS_ERR(ti_thermal)) {
-			dev_err(bgp->dev, "thermal zone device is NULL\n");
 			ret = PTR_ERR(ti_thermal);
 			goto err_free_ref_table;
 		}
diff --git a/drivers/thermal/loongson2_thermal.c b/drivers/thermal/loongson2_thermal.c
index ea4dd2fb1f47..ce978db950e7 100644
--- a/drivers/thermal/loongson2_thermal.c
+++ b/drivers/thermal/loongson2_thermal.c
@@ -168,7 +168,7 @@ static int loongson2_thermal_probe(struct platform_device *pdev)
 		if (PTR_ERR(tzd) != -ENODEV)
 			continue;
 
-		return dev_err_probe(dev, PTR_ERR(tzd), "failed to register");
+		return PTR_ERR(tzd);
 	}
 
 	ret = devm_request_threaded_irq(dev, irq, NULL, loongson2_thermal_irq_thread,
diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 3beff9b6fac3..adf46b74ecc7 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -1681,12 +1681,8 @@ rockchip_thermal_register_sensor(struct platform_device *pdev,
 	sensor->id = id;
 	sensor->tzd = devm_thermal_of_zone_register(dev, id, sensor,
 						    &rockchip_of_thermal_ops);
-	if (IS_ERR(sensor->tzd)) {
-		error = PTR_ERR(sensor->tzd);
-		dev_err(dev, "failed to register sensor %d: %d\n",
-			id, error);
-		return error;
-	}
+	if (IS_ERR(sensor->tzd))
+		return PTR_ERR(sensor->tzd);
 
 	return 0;
 }
diff --git a/drivers/thermal/sprd_thermal.c b/drivers/thermal/sprd_thermal.c
index e546067c9621..d92964a931a4 100644
--- a/drivers/thermal/sprd_thermal.c
+++ b/drivers/thermal/sprd_thermal.c
@@ -409,8 +409,6 @@ static int sprd_thm_probe(struct platform_device *pdev)
 							 sen,
 							 &sprd_thm_ops);
 		if (IS_ERR(sen->tzd)) {
-			dev_err(&pdev->dev, "register thermal zone failed %d\n",
-				sen->id);
 			ret = PTR_ERR(sen->tzd);
 			goto of_put;
 		}
diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c
index ee3d0aa31406..b370c7ed808b 100644
--- a/drivers/thermal/thermal-generic-adc.c
+++ b/drivers/thermal/thermal-generic-adc.c
@@ -142,14 +142,8 @@ static int gadc_thermal_probe(struct platform_device *pdev)
 
 	gti->tz_dev = devm_thermal_of_zone_register(dev, 0, gti,
 						    &gadc_thermal_ops);
-	if (IS_ERR(gti->tz_dev)) {
-		ret = PTR_ERR(gti->tz_dev);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev,
-				"Thermal zone sensor register failed: %d\n",
-				ret);
-		return ret;
-	}
+	if (IS_ERR(gti->tz_dev))
+		return PTR_ERR(gti->tz_dev);
 
 	devm_thermal_add_hwmon_sysfs(dev, gti->tz_dev);
 
diff --git a/drivers/thermal/thermal_mmio.c b/drivers/thermal/thermal_mmio.c
index 6845756ad5e7..bd302dae5047 100644
--- a/drivers/thermal/thermal_mmio.c
+++ b/drivers/thermal/thermal_mmio.c
@@ -69,12 +69,8 @@ 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));
+	if (IS_ERR(thermal_zone))
 		return PTR_ERR(thermal_zone);
-	}
 
 	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 1a04294effea..a5e6353f2da7 100644
--- a/drivers/thermal/uniphier_thermal.c
+++ b/drivers/thermal/uniphier_thermal.c
@@ -308,10 +308,8 @@ static int uniphier_tm_probe(struct platform_device *pdev)
 
 	tdev->tz_dev = devm_thermal_of_zone_register(dev, 0, tdev,
 						     &uniphier_of_thermal_ops);
-	if (IS_ERR(tdev->tz_dev)) {
-		dev_err(dev, "failed to register sensor device\n");
+	if (IS_ERR(tdev->tz_dev))
 		return PTR_ERR(tdev->tz_dev);
-	}
 
 	/* set alert temperatures */
 	twd.tdev = tdev;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 06/12] thermal: broadcom: Remove redundant error log prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
                   ` (4 preceding siblings ...)
  2025-09-05  7:23 ` [PATCH 05/12] thermal: " Xichao Zhao
@ 2025-09-05  7:23 ` Xichao Zhao
  2025-09-05  7:23 ` [PATCH 07/12] thermal: qcom: " Xichao Zhao
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:23 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:ARM/QUALCOMM MAILING LIST,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/thermal/broadcom/bcm2711_thermal.c | 7 ++-----
 drivers/thermal/broadcom/bcm2835_thermal.c | 2 +-
 drivers/thermal/broadcom/brcmstb_thermal.c | 3 +--
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/thermal/broadcom/bcm2711_thermal.c b/drivers/thermal/broadcom/bcm2711_thermal.c
index 03ac2d02e9d4..962dbec5e6ef 100644
--- a/drivers/thermal/broadcom/bcm2711_thermal.c
+++ b/drivers/thermal/broadcom/bcm2711_thermal.c
@@ -90,11 +90,8 @@ static int bcm2711_thermal_probe(struct platform_device *pdev)
 
 	thermal = devm_thermal_of_zone_register(dev, 0, priv,
 						&bcm2711_thermal_of_ops);
-	if (IS_ERR(thermal)) {
-		ret = PTR_ERR(thermal);
-		dev_err(dev, "could not register sensor: %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(thermal))
+		return PTR_ERR(thermal);
 
 	priv->thermal = thermal;
 
diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
index 685a5aee5e0d..c4205ae68e80 100644
--- a/drivers/thermal/broadcom/bcm2835_thermal.c
+++ b/drivers/thermal/broadcom/bcm2835_thermal.c
@@ -198,7 +198,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
 	/* register of thermal sensor and get info from DT */
 	tz = devm_thermal_of_zone_register(dev, 0, data, &bcm2835_thermal_ops);
 	if (IS_ERR(tz))
-		return dev_err_probe(dev, PTR_ERR(tz), "Failed to register the thermal device\n");
+		return PTR_ERR(tz);
 
 	/*
 	 * right now the FW does set up the HW-block, so we are not
diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c
index f46f2ddc174e..efc8bfd04f68 100644
--- a/drivers/thermal/broadcom/brcmstb_thermal.c
+++ b/drivers/thermal/broadcom/brcmstb_thermal.c
@@ -346,8 +346,7 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
 	thermal = devm_thermal_of_zone_register(&pdev->dev, 0, priv,
 						of_ops);
 	if (IS_ERR(thermal))
-		return dev_err_probe(&pdev->dev, PTR_ERR(thermal),
-					"could not register sensor\n");
+		return PTR_ERR(thermal);
 
 	priv->thermal = thermal;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 07/12] thermal: qcom: Remove redundant error log prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
                   ` (5 preceding siblings ...)
  2025-09-05  7:23 ` [PATCH 06/12] thermal: broadcom: " Xichao Zhao
@ 2025-09-05  7:23 ` Xichao Zhao
  2025-09-05  7:24 ` [PATCH 08/12] thermal: renesas: " Xichao Zhao
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:23 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:ARM/QUALCOMM MAILING LIST,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c    | 7 +------
 drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 3 +--
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
index d7f2e6ca92c2..0ab14153e74d 100644
--- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
+++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
@@ -677,14 +677,9 @@ static int adc_tm5_register_tzd(struct adc_tm5_chip *adc_tm)
 						    &adc_tm->channels[i],
 						    &adc_tm5_thermal_ops);
 		if (IS_ERR(tzd)) {
-			if (PTR_ERR(tzd) == -ENODEV) {
-				dev_dbg(adc_tm->dev, "thermal sensor on channel %d is not used\n",
-					 adc_tm->channels[i].channel);
+			if (PTR_ERR(tzd) == -ENODEV)
 				continue;
-			}
 
-			dev_err(adc_tm->dev, "Error registering TZ zone for channel %d: %ld\n",
-				adc_tm->channels[i].channel, PTR_ERR(tzd));
 			return PTR_ERR(tzd);
 		}
 		adc_tm->channels[i].tzd = tzd;
diff --git a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
index f39ca0ddd17b..96f254f8816e 100644
--- a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
+++ b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
@@ -867,8 +867,7 @@ static int qpnp_tm_probe(struct platform_device *pdev)
 	chip->tz_dev = devm_thermal_of_zone_register(
 		&pdev->dev, 0, chip, chip->data->ops);
 	if (IS_ERR(chip->tz_dev))
-		return dev_err_probe(&pdev->dev, PTR_ERR(chip->tz_dev),
-				     "failed to register sensor\n");
+		return PTR_ERR(chip->tz_dev);
 
 	ret = qpnp_tm_init(chip);
 	if (ret < 0)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 08/12] thermal: renesas: Remove redundant error log prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
                   ` (6 preceding siblings ...)
  2025-09-05  7:23 ` [PATCH 07/12] thermal: qcom: " Xichao Zhao
@ 2025-09-05  7:24 ` Xichao Zhao
  2025-09-05  7:24 ` [PATCH 09/12] thermal: samsung: " Xichao Zhao
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:24 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:ARM/QUALCOMM MAILING LIST,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/thermal/renesas/rcar_gen3_thermal.c | 1 -
 drivers/thermal/renesas/rcar_thermal.c      | 3 ++-
 drivers/thermal/renesas/rzg2l_thermal.c     | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/renesas/rcar_gen3_thermal.c b/drivers/thermal/renesas/rcar_gen3_thermal.c
index 24a702ee4c1f..4788fd311887 100644
--- a/drivers/thermal/renesas/rcar_gen3_thermal.c
+++ b/drivers/thermal/renesas/rcar_gen3_thermal.c
@@ -540,7 +540,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
 
 		zone = devm_thermal_of_zone_register(dev, i, tsc, &priv->ops);
 		if (IS_ERR(zone)) {
-			dev_err(dev, "Sensor %u: Can't register thermal zone\n", i);
 			ret = PTR_ERR(zone);
 			goto error_unregister;
 		}
diff --git a/drivers/thermal/renesas/rcar_thermal.c b/drivers/thermal/renesas/rcar_thermal.c
index fdd7afdc4ff6..a623f21520ef 100644
--- a/drivers/thermal/renesas/rcar_thermal.c
+++ b/drivers/thermal/renesas/rcar_thermal.c
@@ -498,9 +498,10 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 				thermal_zone_device_unregister(priv->zone);
 				priv->zone = ERR_PTR(ret);
 			}
+			if (IS_ERR(priv->zone))
+				dev_err(dev, "can't register thermal zone\n");
 		}
 		if (IS_ERR(priv->zone)) {
-			dev_err(dev, "can't register thermal zone\n");
 			ret = PTR_ERR(priv->zone);
 			priv->zone = NULL;
 			goto error_unregister;
diff --git a/drivers/thermal/renesas/rzg2l_thermal.c b/drivers/thermal/renesas/rzg2l_thermal.c
index b588be628640..3b13ccd5e76a 100644
--- a/drivers/thermal/renesas/rzg2l_thermal.c
+++ b/drivers/thermal/renesas/rzg2l_thermal.c
@@ -208,7 +208,6 @@ static int rzg2l_thermal_probe(struct platform_device *pdev)
 	zone = devm_thermal_of_zone_register(dev, 0, priv,
 					     &rzg2l_tz_of_ops);
 	if (IS_ERR(zone)) {
-		dev_err(dev, "Can't register thermal zone");
 		ret = PTR_ERR(zone);
 		goto err;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 09/12] thermal: samsung: Remove redundant error log prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
                   ` (7 preceding siblings ...)
  2025-09-05  7:24 ` [PATCH 08/12] thermal: renesas: " Xichao Zhao
@ 2025-09-05  7:24 ` Xichao Zhao
  2025-09-05  7:24 ` [PATCH 10/12] thermal: st: " Xichao Zhao
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:24 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:ARM/QUALCOMM MAILING LIST,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/thermal/samsung/exynos_tmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 47a99b3c5395..d09637d64f6f 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1087,7 +1087,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 	data->tzd = devm_thermal_of_zone_register(dev, 0, data,
 						  &exynos_sensor_ops);
 	if (IS_ERR(data->tzd)) {
-		ret = dev_err_probe(dev, PTR_ERR(data->tzd), "Failed to register sensor\n");
+		ret = PTR_ERR(data->tzd);
 		goto err_sclk;
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 10/12] thermal: st: Remove redundant error log prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
                   ` (8 preceding siblings ...)
  2025-09-05  7:24 ` [PATCH 09/12] thermal: samsung: " Xichao Zhao
@ 2025-09-05  7:24 ` Xichao Zhao
  2025-09-05  7:24 ` [PATCH 11/12] thermal: tegra: " Xichao Zhao
  2025-09-05  7:24 ` [PATCH 12/12] thermal: ti-soc-thermal: " Xichao Zhao
  11 siblings, 0 replies; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:24 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/thermal/st/st_thermal.c  | 1 -
 drivers/thermal/st/stm_thermal.c | 8 ++------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c
index 1470ca519def..6d0c163658c4 100644
--- a/drivers/thermal/st/st_thermal.c
+++ b/drivers/thermal/st/st_thermal.c
@@ -198,7 +198,6 @@ int st_thermal_register(struct platform_device *pdev,
 	sensor->thermal_dev =
 		devm_thermal_of_zone_register(dev, 0, sensor, &st_tz_ops);
 	if (IS_ERR(sensor->thermal_dev)) {
-		dev_err(dev, "failed to register thermal of zone\n");
 		ret = PTR_ERR(sensor->thermal_dev);
 		goto sensor_off;
 	}
diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c
index 6e90eb9f414d..963c347d0ef5 100644
--- a/drivers/thermal/st/stm_thermal.c
+++ b/drivers/thermal/st/stm_thermal.c
@@ -536,12 +536,8 @@ static int stm_thermal_probe(struct platform_device *pdev)
 						       sensor,
 						       &stm_tz_ops);
 
-	if (IS_ERR(sensor->th_dev)) {
-		dev_err(&pdev->dev, "%s: thermal zone sensor registering KO\n",
-			__func__);
-		ret = PTR_ERR(sensor->th_dev);
-		return ret;
-	}
+	if (IS_ERR(sensor->th_dev))
+		return PTR_ERR(sensor->th_dev);
 
 	/* Register IRQ into GIC */
 	ret = stm_register_irq(sensor);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 11/12] thermal: tegra: Remove redundant error log prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
                   ` (9 preceding siblings ...)
  2025-09-05  7:24 ` [PATCH 10/12] thermal: st: " Xichao Zhao
@ 2025-09-05  7:24 ` Xichao Zhao
  2025-09-05  7:24 ` [PATCH 12/12] thermal: ti-soc-thermal: " Xichao Zhao
  11 siblings, 0 replies; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:24 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/thermal/tegra/soctherm.c        | 2 --
 drivers/thermal/tegra/tegra30-tsensor.c | 3 +--
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index 53a5c649f4b1..3db20d34f88c 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -2186,8 +2186,6 @@ static int tegra_soctherm_probe(struct platform_device *pdev)
 						  &tegra_of_thermal_ops);
 		if (IS_ERR(z)) {
 			err = PTR_ERR(z);
-			dev_err(&pdev->dev, "failed to register sensor: %d\n",
-				err);
 			goto disable_clocks;
 		}
 
diff --git a/drivers/thermal/tegra/tegra30-tsensor.c b/drivers/thermal/tegra/tegra30-tsensor.c
index 6245f6b97f43..7bb9776c4172 100644
--- a/drivers/thermal/tegra/tegra30-tsensor.c
+++ b/drivers/thermal/tegra/tegra30-tsensor.c
@@ -517,8 +517,7 @@ static int tegra_tsensor_register_channel(struct tegra_tsensor *ts,
 	tsc->tzd = devm_thermal_of_zone_register(ts->dev, id, tsc, &ops);
 	if (IS_ERR(tsc->tzd)) {
 		if (PTR_ERR(tsc->tzd) != -ENODEV)
-			return dev_err_probe(ts->dev, PTR_ERR(tsc->tzd),
-					     "failed to register thermal zone\n");
+			return PTR_ERR(tsc->tzd);
 
 		/*
 		 * It's okay if sensor isn't assigned to any thermal zone
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 12/12] thermal: ti-soc-thermal: Remove redundant error log  prints
  2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
                   ` (10 preceding siblings ...)
  2025-09-05  7:24 ` [PATCH 11/12] thermal: tegra: " Xichao Zhao
@ 2025-09-05  7:24 ` Xichao Zhao
  11 siblings, 0 replies; 20+ messages in thread
From: Xichao Zhao @ 2025-09-05  7:24 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER
  Cc: Xichao Zhao

devm_thermal_of_zone_register() prints error log messages when
it fails, so there is no need to print error log messages again.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 0cf0826b805a..e07a82eb8c3b 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -175,10 +175,8 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
 	/* in case this is specified by DT */
 	data->ti_thermal = devm_thermal_of_zone_register(bgp->dev, id,
 					data, &ti_of_thermal_ops);
-	if (IS_ERR(data->ti_thermal)) {
-		dev_err(bgp->dev, "thermal zone device is NULL\n");
+	if (IS_ERR(data->ti_thermal))
 		return PTR_ERR(data->ti_thermal);
-	}
 
 	ti_bandgap_set_sensor_data(bgp, id, data);
 	ti_bandgap_write_update_interval(bgp, data->sensor_id,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH 03/12] iio: adc: Remove redundant error log prints
  2025-09-05  7:23 ` [PATCH 03/12] iio: adc: " Xichao Zhao
@ 2025-09-05  7:37   ` Chen-Yu Tsai
  0 siblings, 0 replies; 20+ messages in thread
From: Chen-Yu Tsai @ 2025-09-05  7:37 UTC (permalink / raw)
  To: Xichao Zhao
  Cc: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Jernej Skrabec, Samuel Holland,
	Liam Girdwood, Mark Brown, Rafael J. Wysocki, Daniel Lezcano,
	Zhang Rui, Lukasz Luba, Guillaume La Roque, Miquel Raynal,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, Markus Mayer, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, zhanghongchen, Yinbo Zhu,
	Amit Kucheria, Thara Gopinath, Niklas Söderlund,
	Geert Uytterhoeven, Magnus Damm, Heiko Stuebner,
	Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Alim Akhtar,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Maxime Coquelin,
	Alexandre Torgue, Thierry Reding, Jonathan Hunter, Talel Shenhar,
	Eduardo Valentin, Keerthy, Kunihiko Hayashi, Masami Hiramatsu,
	open list:HARDWARE MONITORING, open list,
	open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER

On Fri, Sep 5, 2025 at 3:26 PM Xichao Zhao <zhao.xichao@vivo.com> wrote:
>
> devm_thermal_of_zone_register() prints error log messages when
> it fails, so there is no need to print error log messages again.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
>  drivers/iio/adc/sun4i-gpadc-iio.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
> index 6b8d6bee1873..3b33480813fe 100644
> --- a/drivers/iio/adc/sun4i-gpadc-iio.c
> +++ b/drivers/iio/adc/sun4i-gpadc-iio.c
> @@ -640,12 +640,8 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
>                  * Do not fail driver probing when failing to register in
>                  * thermal because no thermal DT node is found.
>                  */
> -               if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV) {
> -                       dev_err(&pdev->dev,
> -                               "could not register thermal sensor: %ld\n",
> -                               PTR_ERR(info->tzd));
> +               if (IS_ERR(info->tzd) && PTR_ERR(info->tzd) != -ENODEV)

I think the comment above is pretty clear that we don't want a failure
or an error message when it is failing just because the DT is missing
thermal zones.

ChenYu

>                         return PTR_ERR(info->tzd);
> -               }
>         }
>
>         ret = devm_iio_device_register(&pdev->dev, indio_dev);
> --
> 2.34.1
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register()
  2025-09-05  7:23 ` [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register() Xichao Zhao
@ 2025-09-05  7:56   ` Niklas Söderlund
  2025-09-05  9:33   ` Andy Shevchenko
  2025-09-05 14:28   ` Guenter Roeck
  2 siblings, 0 replies; 20+ messages in thread
From: Niklas Söderlund @ 2025-09-05  7:56 UTC (permalink / raw)
  To: Xichao Zhao
  Cc: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Geert Uytterhoeven, Magnus Damm, Heiko Stuebner,
	Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Alim Akhtar,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Maxime Coquelin,
	Alexandre Torgue, Thierry Reding, Jonathan Hunter, Talel Shenhar,
	Eduardo Valentin, Keerthy, Kunihiko Hayashi, Masami Hiramatsu,
	open list:HARDWARE MONITORING, open list,
	open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER

Hello Xichao,

Thanks for your work.

On 2025-09-05 15:23:53 +0800, Xichao Zhao wrote:
> devm_thermal_of_zone_register() does not print any error message
> when registering a thermal zone with a device node sensor fails
> and allocating device resource data fails.
> 
> This forces each driver to implement redundant error logging.
> Additionally, when upper-layer functions propagate these errors
> without logging, critical debugging information is lost.
> 
> Add dev_err_probe() in devm_thermal_of_zone_register() to unify
> error reporting.
> 
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
>  drivers/thermal/thermal_of.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> index 1a51a4d240ff..8fe0ad402579 100644
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
> @@ -475,11 +475,15 @@ struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, in
>  
>  	ptr = devres_alloc(devm_thermal_of_zone_release, sizeof(*ptr),
>  			   GFP_KERNEL);
> -	if (!ptr)
> +	if (!ptr) {
> +		dev_err(dev, "Failed to allocate device resource data\n");
>  		return ERR_PTR(-ENOMEM);
> +	}
>  
>  	tzd = thermal_of_zone_register(dev->of_node, sensor_id, data, ops);
>  	if (IS_ERR(tzd)) {
> +		dev_err_probe(dev, PTR_ERR(tzd),
> +			      "Failed to register thermal zone sensor[%d]\n", sensor_id);

Don't thermal_of_zone_register() already print an error message for 
failure cases? If not can this print be moved there? That would allow 
the change you make in R-Car drivers to remove the prating completely, 
not just for the devm_* cases.

>  		devres_free(ptr);
>  		return tzd;
>  	}
> -- 
> 2.34.1
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register()
  2025-09-05  7:23 ` [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register() Xichao Zhao
  2025-09-05  7:56   ` Niklas Söderlund
@ 2025-09-05  9:33   ` Andy Shevchenko
  2025-09-05  9:35     ` Andy Shevchenko
  2025-09-05 14:28   ` Guenter Roeck
  2 siblings, 1 reply; 20+ messages in thread
From: Andy Shevchenko @ 2025-09-05  9:33 UTC (permalink / raw)
  To: Xichao Zhao
  Cc: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER

On Fri, Sep 5, 2025 at 10:25 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:
>
> devm_thermal_of_zone_register() does not print any error message
> when registering a thermal zone with a device node sensor fails
> and allocating device resource data fails.
>
> This forces each driver to implement redundant error logging.
> Additionally, when upper-layer functions propagate these errors
> without logging, critical debugging information is lost.
>
> Add dev_err_probe() in devm_thermal_of_zone_register() to unify
> error reporting.

...

>         ptr = devres_alloc(devm_thermal_of_zone_release, sizeof(*ptr),
>                            GFP_KERNEL);
> -       if (!ptr)
> +       if (!ptr) {

> +               dev_err(dev, "Failed to allocate device resource data\n");

We do not add error messages for ENOMEM.

>                 return ERR_PTR(-ENOMEM);

Even if you want so eagerly to do that, it should be

   return dev_err_probe();

But, it will ignore the ENOMEM error code for printing.

> +       }

So, the bottom line, no need to add this message here.

...

>         tzd = thermal_of_zone_register(dev->of_node, sensor_id, data, ops);
>         if (IS_ERR(tzd)) {
> +               dev_err_probe(dev, PTR_ERR(tzd),
> +                             "Failed to register thermal zone sensor[%d]\n", sensor_id);
>                 devres_free(ptr);
>                 return tzd;

I don't see how ptr is related to the mesasge. Can't we use

  return dev_err_probe(dev, PTR_ERR(...), ...);

instead?

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register()
  2025-09-05  9:33   ` Andy Shevchenko
@ 2025-09-05  9:35     ` Andy Shevchenko
  0 siblings, 0 replies; 20+ messages in thread
From: Andy Shevchenko @ 2025-09-05  9:35 UTC (permalink / raw)
  To: Xichao Zhao
  Cc: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER

On Fri, Sep 5, 2025 at 12:33 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Fri, Sep 5, 2025 at 10:25 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:

...

> >         ptr = devres_alloc(devm_thermal_of_zone_release, sizeof(*ptr),
> >                            GFP_KERNEL);
> > -       if (!ptr)
> > +       if (!ptr) {
>
> > +               dev_err(dev, "Failed to allocate device resource data\n");
>
> We do not add error messages for ENOMEM.
>
> >                 return ERR_PTR(-ENOMEM);
>
> Even if you want so eagerly to do that, it should be
>
>    return dev_err_probe();
>
> But, it will ignore the ENOMEM error code for printing.
>
> > +       }
>
> So, the bottom line, no need to add this message here.

...

> >         tzd = thermal_of_zone_register(dev->of_node, sensor_id, data, ops);
> >         if (IS_ERR(tzd)) {
> > +               dev_err_probe(dev, PTR_ERR(tzd),
> > +                             "Failed to register thermal zone sensor[%d]\n", sensor_id);
> >                 devres_free(ptr);
> >                 return tzd;
>
> I don't see how ptr is related to the message. Can't we use
>
>   return dev_err_probe(dev, PTR_ERR(...), ...);
>
> instead?

On top of that can we actually use devm_add_action_or_reset()?

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 04/12] regulator: max8973: Remove redundant error log prints
  2025-09-05  7:23 ` [PATCH 04/12] regulator: max8973: " Xichao Zhao
@ 2025-09-05 10:42   ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2025-09-05 10:42 UTC (permalink / raw)
  To: Xichao Zhao
  Cc: Jean Delvare, Guenter Roeck, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Rafael J. Wysocki, Daniel Lezcano,
	Zhang Rui, Lukasz Luba, Guillaume La Roque, Miquel Raynal,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, Markus Mayer, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, zhanghongchen, Yinbo Zhu,
	Amit Kucheria, Thara Gopinath, Niklas Söderlund,
	Geert Uytterhoeven, Magnus Damm, Heiko Stuebner,
	Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Alim Akhtar,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Maxime Coquelin,
	Alexandre Torgue, Thierry Reding, Jonathan Hunter, Talel Shenhar,
	Eduardo Valentin, Keerthy, Kunihiko Hayashi, Masami Hiramatsu,
	open list:HARDWARE MONITORING, open list,
	open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

On Fri, Sep 05, 2025 at 03:23:56PM +0800, Xichao Zhao wrote:
> devm_thermal_of_zone_register() prints error log messages when
> it fails, so there is no need to print error log messages again.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register()
  2025-09-05  7:23 ` [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register() Xichao Zhao
  2025-09-05  7:56   ` Niklas Söderlund
  2025-09-05  9:33   ` Andy Shevchenko
@ 2025-09-05 14:28   ` Guenter Roeck
  2 siblings, 0 replies; 20+ messages in thread
From: Guenter Roeck @ 2025-09-05 14:28 UTC (permalink / raw)
  To: Xichao Zhao, Jean Delvare, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER

On 9/5/25 00:23, Xichao Zhao wrote:
> devm_thermal_of_zone_register() does not print any error message
> when registering a thermal zone with a device node sensor fails
> and allocating device resource data fails.
> 
> This forces each driver to implement redundant error logging.
> Additionally, when upper-layer functions propagate these errors
> without logging, critical debugging information is lost.
> 
> Add dev_err_probe() in devm_thermal_of_zone_register() to unify
> error reporting.
> 
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
>   drivers/thermal/thermal_of.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> index 1a51a4d240ff..8fe0ad402579 100644
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
> @@ -475,11 +475,15 @@ struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, in
>   
>   	ptr = devres_alloc(devm_thermal_of_zone_release, sizeof(*ptr),
>   			   GFP_KERNEL);
> -	if (!ptr)
> +	if (!ptr) {
> +		dev_err(dev, "Failed to allocate device resource data\n");
>   		return ERR_PTR(-ENOMEM);
> +	}
>   
>   	tzd = thermal_of_zone_register(dev->of_node, sensor_id, data, ops);
>   	if (IS_ERR(tzd)) {
> +		dev_err_probe(dev, PTR_ERR(tzd),
> +			      "Failed to register thermal zone sensor[%d]\n", sensor_id);

This will print an error message even if the problem is (for the calling code,
such as hwmon) only informational.

Guenter


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 02/12] hwmon: Remove redundant error log prints
  2025-09-05  7:23 ` [PATCH 02/12] hwmon: Remove redundant error log prints Xichao Zhao
@ 2025-09-05 14:31   ` Guenter Roeck
  0 siblings, 0 replies; 20+ messages in thread
From: Guenter Roeck @ 2025-09-05 14:31 UTC (permalink / raw)
  To: Xichao Zhao, Jean Delvare, Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Liam Girdwood, Mark Brown, Rafael J. Wysocki,
	Daniel Lezcano, Zhang Rui, Lukasz Luba, Guillaume La Roque,
	Miquel Raynal, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Markus Mayer, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, zhanghongchen, Yinbo Zhu, Amit Kucheria,
	Thara Gopinath, Niklas Söderlund, Geert Uytterhoeven,
	Magnus Damm, Heiko Stuebner, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski, Alim Akhtar, Orson Zhai, Baolin Wang,
	Chunyan Zhang, Maxime Coquelin, Alexandre Torgue, Thierry Reding,
	Jonathan Hunter, Talel Shenhar, Eduardo Valentin, Keerthy,
	Kunihiko Hayashi, Masami Hiramatsu, open list:HARDWARE MONITORING,
	open list, open list:IIO SUBSYSTEM AND DRIVERS,
	moderated list:ARM/Allwinner sunXi SoC support,
	open list:ARM/Allwinner sunXi SoC support, open list:THERMAL,
	open list:THERMAL DRIVER FOR AMLOGIC SOCS,
	moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	open list:QUALCOMM TSENS THERMAL DRIVER,
	open list:RENESAS R-CAR THERMAL DRIVERS,
	open list:ARM/Rockchip SoC support,
	open list:SAMSUNG THERMAL DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	open list:TEGRA ARCHITECTURE SUPPORT,
	open list:TI BANDGAP AND THERMAL DRIVER

On 9/5/25 00:23, Xichao Zhao wrote:
> devm_thermal_of_zone_register() prints error log messages when
> it fails, so there is no need to print error log messages again.
> 
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
>   drivers/hwmon/hwmon.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
> index 1688c210888a..0514e4bc5e71 100644
> --- a/drivers/hwmon/hwmon.c
> +++ b/drivers/hwmon/hwmon.c
> @@ -239,8 +239,7 @@ static int hwmon_thermal_add_sensor(struct device *dev, int index)
>   	if (IS_ERR(tzd)) {
>   		if (PTR_ERR(tzd) != -ENODEV)
>   			return PTR_ERR(tzd);
> -		dev_info(dev, "temp%d_input not attached to any thermal zone\n",
> -			 index + 1);
> +

This series moves the message from an informational message here to an error message
in the thermal core, even though it is (for hwmon) not an error. I personally
think this is a bad idea. Can we get another API that lets me suppress that error
message ?

Guenter

>   		devm_kfree(dev, tdata);
>   		return 0;
>   	}


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-09-05 14:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05  7:23 [PATCH 00/12] drivers: Integrate log message printing into devm_thermal_*_register() Xichao Zhao
2025-09-05  7:23 ` [PATCH 01/12] thermal: of: Add error handling in devm_thermal_*_register() Xichao Zhao
2025-09-05  7:56   ` Niklas Söderlund
2025-09-05  9:33   ` Andy Shevchenko
2025-09-05  9:35     ` Andy Shevchenko
2025-09-05 14:28   ` Guenter Roeck
2025-09-05  7:23 ` [PATCH 02/12] hwmon: Remove redundant error log prints Xichao Zhao
2025-09-05 14:31   ` Guenter Roeck
2025-09-05  7:23 ` [PATCH 03/12] iio: adc: " Xichao Zhao
2025-09-05  7:37   ` Chen-Yu Tsai
2025-09-05  7:23 ` [PATCH 04/12] regulator: max8973: " Xichao Zhao
2025-09-05 10:42   ` Mark Brown
2025-09-05  7:23 ` [PATCH 05/12] thermal: " Xichao Zhao
2025-09-05  7:23 ` [PATCH 06/12] thermal: broadcom: " Xichao Zhao
2025-09-05  7:23 ` [PATCH 07/12] thermal: qcom: " Xichao Zhao
2025-09-05  7:24 ` [PATCH 08/12] thermal: renesas: " Xichao Zhao
2025-09-05  7:24 ` [PATCH 09/12] thermal: samsung: " Xichao Zhao
2025-09-05  7:24 ` [PATCH 10/12] thermal: st: " Xichao Zhao
2025-09-05  7:24 ` [PATCH 11/12] thermal: tegra: " Xichao Zhao
2025-09-05  7:24 ` [PATCH 12/12] thermal: ti-soc-thermal: " Xichao Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox