public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v3 01/12] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs()
@ 2023-06-13 11:48 Yangtao Li
  2023-06-13 11:48 ` [PATCH v3 02/12] thermal/drivers/sun8i: remove redundant msg in sun8i_ths_register() Yangtao Li
                   ` (10 more replies)
  0 siblings, 11 replies; 16+ messages in thread
From: Yangtao Li @ 2023-06-13 11:48 UTC (permalink / raw)
  To: glaroque, rafael, daniel.lezcano, amitk, rui.zhang, shawnguo,
	s.hauer, kernel, festevam, linux-imx, thara.gopinath, agross,
	andersson, konrad.dybcio, anarsoul, tiny.windzz, wens,
	jernej.skrabec, samuel, thierry.reding, jonathanh, edubezval,
	j-keerthy, matthias.bgg, angelogioacchino.delregno, bchihi,
	niklas.soderlund+renesas, wenst
  Cc: linux-pm, linux-amlogic, linux-kernel, linux-arm-kernel,
	linux-arm-msm, linux-sunxi, linux-tegra, linux-omap,
	linux-mediatek, Yangtao Li

Ensure that all error handling branches print error information. In this
way, when this function fails, the upper-layer functions can directly
return an error code without missing debugging information. Otherwise,
the error message will be printed redundantly or missing.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
v3:
-cleanup lvts_thermal
v2:
-convert to dev_warn
 drivers/thermal/thermal_hwmon.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
index fbe55509e307..c3ae44659b81 100644
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -271,11 +271,14 @@ int devm_thermal_add_hwmon_sysfs(struct device *dev, struct thermal_zone_device
 
 	ptr = devres_alloc(devm_thermal_hwmon_release, sizeof(*ptr),
 			   GFP_KERNEL);
-	if (!ptr)
+	if (!ptr) {
+		dev_warn(dev, "Failed to allocate device resource data\n");
 		return -ENOMEM;
+	}
 
 	ret = thermal_add_hwmon_sysfs(tz);
 	if (ret) {
+		dev_warn(dev, "Failed to add hwmon sysfs attributes\n");
 		devres_free(ptr);
 		return ret;
 	}
-- 
2.39.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-06-19 15:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-13 11:48 [PATCH v3 01/12] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Yangtao Li
2023-06-13 11:48 ` [PATCH v3 02/12] thermal/drivers/sun8i: remove redundant msg in sun8i_ths_register() Yangtao Li
2023-06-18  5:55   ` Jernej Škrabec
2023-06-13 11:48 ` [PATCH v3 03/12] thermal/drivers/amlogic: remove redundant msg in amlogic_thermal_probe() Yangtao Li
2023-06-13 11:48 ` [PATCH v3 04/12] thermal/drivers/imx: remove redundant msg in imx8mm_tmu_probe() and imx_sc_thermal_probe() Yangtao Li
2023-06-13 11:48 ` [PATCH v3 05/12] drivers/thermal/k3: remove redundant msg in k3_bandgap_probe() Yangtao Li
2023-06-13 11:48 ` [PATCH v3 06/12] thermal/drivers/tegra: remove redundant msg in tegra_tsensor_register_channel() Yangtao Li
2023-06-13 11:48 ` [PATCH v3 07/12] thermal/drivers/qoriq: remove redundant msg in qoriq_tmu_register_tmu_zone() Yangtao Li
2023-06-13 11:49 ` [PATCH v3 08/12] thermal/drivers/ti-soc: remove redundant msg in ti_thermal_expose_sensor() Yangtao Li
2023-06-13 12:55   ` J, KEERTHY
2023-06-13 11:49 ` [PATCH v3 09/12] thermal/drivers/qcom: remove redundant msg Yangtao Li
2023-06-13 11:49 ` [PATCH v3 10/12] thermal/drivers/mediatek/lvts_thermal: " Yangtao Li
2023-06-13 11:49 ` [PATCH v3 11/12] thermal/drivers/generic-adc: Register thermal zones as hwmon sensors Yangtao Li
2023-06-19 15:17   ` Matthias Brugger
2023-06-19 15:33     ` Chen-Yu Tsai
2023-06-13 11:49 ` [PATCH v3 12/12] thermal/drivers/generic-adc: remove redundant msg in gadc_thermal_probe() Yangtao Li

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