linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 01/11] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs()
@ 2023-06-13 11:24 Yangtao Li
  2023-06-13 11:24 ` [PATCH v2 02/11] thermal/drivers/sun8i: remove redundant msg in sun8i_ths_register() Yangtao Li
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Yangtao Li @ 2023-06-13 11:24 UTC (permalink / raw)
  To: glaroque, rafael, daniel.lezcano, amitk, rui.zhang, shawnguo,
	s.hauer, kernel, festevam, linux-imx, agross, andersson,
	konrad.dybcio, thara.gopinath, anarsoul, tiny.windzz, wens,
	jernej.skrabec, samuel, thierry.reding, jonathanh, edubezval,
	j-keerthy, f.fainelli
  Cc: linux-pm, linux-amlogic, linux-kernel, linux-arm-kernel,
	linux-arm-msm, linux-sunxi, linux-tegra, linux-omap, 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>
---
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


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

end of thread, other threads:[~2023-06-13 11:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-13 11:24 [PATCH v2 01/11] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Yangtao Li
2023-06-13 11:24 ` [PATCH v2 02/11] thermal/drivers/sun8i: remove redundant msg in sun8i_ths_register() Yangtao Li
2023-06-13 11:24 ` [PATCH v2 03/11] thermal/drivers/amlogic: remove redundant msg in amlogic_thermal_probe() Yangtao Li
2023-06-13 11:24 ` [PATCH v2 04/11] thermal/drivers/imx: remove redundant msg in imx8mm_tmu_probe() and imx_sc_thermal_probe() Yangtao Li
2023-06-13 11:24 ` [PATCH v2 05/11] drivers/thermal/k3: remove redundant msg in k3_bandgap_probe() Yangtao Li
2023-06-13 11:24 ` [PATCH v2 06/11] thermal/drivers/tegra: remove redundant msg in tegra_tsensor_register_channel() Yangtao Li
2023-06-13 11:24 ` [PATCH v2 07/11] thermal/drivers/qoriq: remove redundant msg in qoriq_tmu_register_tmu_zone() Yangtao Li
2023-06-13 11:24 ` [PATCH v2 08/11] thermal/drivers/ti-soc: remove redundant msg in ti_thermal_expose_sensor() Yangtao Li
2023-06-13 11:24 ` [PATCH v2 09/11] thermal/drivers/qcom: remove redundant msg Yangtao Li
2023-06-13 11:24 ` [PATCH v2 10/11] thermal/drivers/generic-adc: Register thermal zones as hwmon sensors Yangtao Li
2023-06-13 11:24 ` [PATCH v2 11/11] 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;
as well as URLs for NNTP newsgroup(s).