* [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
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 02/12] thermal/drivers/sun8i: remove redundant msg in sun8i_ths_register()
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 ` 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
` (9 subsequent siblings)
10 siblings, 1 reply; 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
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/sun8i_thermal.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c
index 793ddce72132..066f9fed9b86 100644
--- a/drivers/thermal/sun8i_thermal.c
+++ b/drivers/thermal/sun8i_thermal.c
@@ -475,9 +475,7 @@ static int sun8i_ths_register(struct ths_device *tmdev)
if (IS_ERR(tmdev->sensor[i].tzd))
return PTR_ERR(tmdev->sensor[i].tzd);
- if (devm_thermal_add_hwmon_sysfs(tmdev->dev, tmdev->sensor[i].tzd))
- dev_warn(tmdev->dev,
- "Failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(tmdev->dev, tmdev->sensor[i].tzd);
}
return 0;
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 03/12] thermal/drivers/amlogic: remove redundant msg in amlogic_thermal_probe()
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-13 11:48 ` 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
` (8 subsequent siblings)
10 siblings, 0 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, Martin Blumenstingl
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
drivers/thermal/amlogic_thermal.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index 3abc2dcef408..756b218880a7 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -282,8 +282,7 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
return ret;
}
- if (devm_thermal_add_hwmon_sysfs(&pdev->dev, pdata->tzd))
- dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(&pdev->dev, pdata->tzd);
ret = amlogic_thermal_initialize(pdata);
if (ret)
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 04/12] thermal/drivers/imx: remove redundant msg in imx8mm_tmu_probe() and imx_sc_thermal_probe()
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-13 11:48 ` [PATCH v3 03/12] thermal/drivers/amlogic: remove redundant msg in amlogic_thermal_probe() Yangtao Li
@ 2023-06-13 11:48 ` Yangtao Li
2023-06-13 11:48 ` [PATCH v3 05/12] drivers/thermal/k3: remove redundant msg in k3_bandgap_probe() Yangtao Li
` (7 subsequent siblings)
10 siblings, 0 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
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/imx8mm_thermal.c | 3 +--
drivers/thermal/imx_sc_thermal.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c
index d8005e9ec992..d4b40869c7d7 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -343,8 +343,7 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
}
tmu->sensors[i].hw_id = i;
- if (devm_thermal_add_hwmon_sysfs(&pdev->dev, tmu->sensors[i].tzd))
- dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(&pdev->dev, tmu->sensors[i].tzd);
}
platform_set_drvdata(pdev, tmu);
diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c
index 839bb9958f60..8d6b4ef23746 100644
--- a/drivers/thermal/imx_sc_thermal.c
+++ b/drivers/thermal/imx_sc_thermal.c
@@ -116,8 +116,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev)
return ret;
}
- if (devm_thermal_add_hwmon_sysfs(&pdev->dev, sensor->tzd))
- dev_warn(&pdev->dev, "failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(&pdev->dev, sensor->tzd);
}
return 0;
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 05/12] drivers/thermal/k3: remove redundant msg in k3_bandgap_probe()
2023-06-13 11:48 [PATCH v3 01/12] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Yangtao Li
` (2 preceding siblings ...)
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 ` Yangtao Li
2023-06-13 11:48 ` [PATCH v3 06/12] thermal/drivers/tegra: remove redundant msg in tegra_tsensor_register_channel() Yangtao Li
` (6 subsequent siblings)
10 siblings, 0 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
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/k3_bandgap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/k3_bandgap.c b/drivers/thermal/k3_bandgap.c
index 791210458606..1c3e590157ec 100644
--- a/drivers/thermal/k3_bandgap.c
+++ b/drivers/thermal/k3_bandgap.c
@@ -222,8 +222,7 @@ static int k3_bandgap_probe(struct platform_device *pdev)
goto err_alloc;
}
- if (devm_thermal_add_hwmon_sysfs(dev, data[id].tzd))
- dev_warn(dev, "Failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(dev, data[id].tzd);
}
platform_set_drvdata(pdev, bgp);
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 06/12] thermal/drivers/tegra: remove redundant msg in tegra_tsensor_register_channel()
2023-06-13 11:48 [PATCH v3 01/12] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Yangtao Li
` (3 preceding siblings ...)
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 ` 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
` (5 subsequent siblings)
10 siblings, 0 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
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/tegra/tegra30-tsensor.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/tegra/tegra30-tsensor.c b/drivers/thermal/tegra/tegra30-tsensor.c
index cb584a5735ed..c243e9d76d3c 100644
--- a/drivers/thermal/tegra/tegra30-tsensor.c
+++ b/drivers/thermal/tegra/tegra30-tsensor.c
@@ -523,8 +523,7 @@ static int tegra_tsensor_register_channel(struct tegra_tsensor *ts,
return 0;
}
- if (devm_thermal_add_hwmon_sysfs(ts->dev, tsc->tzd))
- dev_warn(ts->dev, "failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(ts->dev, tsc->tzd);
return 0;
}
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 07/12] thermal/drivers/qoriq: remove redundant msg in qoriq_tmu_register_tmu_zone()
2023-06-13 11:48 [PATCH v3 01/12] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Yangtao Li
` (4 preceding siblings ...)
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 ` 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
` (4 subsequent siblings)
10 siblings, 0 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
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/qoriq_thermal.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index e58756323457..61b68034a82e 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -157,10 +157,7 @@ static int qoriq_tmu_register_tmu_zone(struct device *dev,
return ret;
}
- if (devm_thermal_add_hwmon_sysfs(dev, tzd))
- dev_warn(dev,
- "Failed to add hwmon sysfs attributes\n");
-
+ devm_thermal_add_hwmon_sysfs(dev, tzd);
}
return 0;
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 08/12] thermal/drivers/ti-soc: remove redundant msg in ti_thermal_expose_sensor()
2023-06-13 11:48 [PATCH v3 01/12] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Yangtao Li
` (5 preceding siblings ...)
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 ` 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
` (3 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: Yangtao Li @ 2023-06-13 11:49 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
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 6a5335931f4d..d414a4b7a94a 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -182,8 +182,7 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
ti_bandgap_write_update_interval(bgp, data->sensor_id,
TI_BANDGAP_UPDATE_INTERVAL_MS);
- if (devm_thermal_add_hwmon_sysfs(bgp->dev, data->ti_thermal))
- dev_warn(bgp->dev, "failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(bgp->dev, data->ti_thermal);
return 0;
}
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 09/12] thermal/drivers/qcom: remove redundant msg
2023-06-13 11:48 [PATCH v3 01/12] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Yangtao Li
` (6 preceding siblings ...)
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 11:49 ` Yangtao Li
2023-06-13 11:49 ` [PATCH v3 10/12] thermal/drivers/mediatek/lvts_thermal: " Yangtao Li
` (2 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-06-13 11:49 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, Dmitry Baryshkov
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 4 +---
drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 4 +---
drivers/thermal/qcom/tsens.c | 4 +---
3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
index 5749149ae2e4..5ddc39b2be32 100644
--- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
+++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
@@ -689,9 +689,7 @@ static int adc_tm5_register_tzd(struct adc_tm5_chip *adc_tm)
return PTR_ERR(tzd);
}
adc_tm->channels[i].tzd = tzd;
- if (devm_thermal_add_hwmon_sysfs(adc_tm->dev, tzd))
- dev_warn(adc_tm->dev,
- "Failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(adc_tm->dev, tzd);
}
return 0;
diff --git a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
index 0f88e98428ac..2a3b3e21260f 100644
--- a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
+++ b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
@@ -459,9 +459,7 @@ static int qpnp_tm_probe(struct platform_device *pdev)
return ret;
}
- if (devm_thermal_add_hwmon_sysfs(&pdev->dev, chip->tz_dev))
- dev_warn(&pdev->dev,
- "Failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(&pdev->dev, chip->tz_dev);
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, qpnp_tm_isr,
IRQF_ONESHOT, node->name, chip);
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index d3218127e617..f99b0539468b 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -1189,9 +1189,7 @@ static int tsens_register(struct tsens_priv *priv)
if (priv->ops->enable)
priv->ops->enable(priv, i);
- if (devm_thermal_add_hwmon_sysfs(priv->dev, tzd))
- dev_warn(priv->dev,
- "Failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(priv->dev, tzd);
}
/* VER_0 require to set MIN and MAX THRESH
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 10/12] thermal/drivers/mediatek/lvts_thermal: remove redundant msg
2023-06-13 11:48 [PATCH v3 01/12] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Yangtao Li
` (7 preceding siblings ...)
2023-06-13 11:49 ` [PATCH v3 09/12] thermal/drivers/qcom: remove redundant msg Yangtao Li
@ 2023-06-13 11:49 ` 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-13 11:49 ` [PATCH v3 12/12] thermal/drivers/generic-adc: remove redundant msg in gadc_thermal_probe() Yangtao Li
10 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-06-13 11:49 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
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/mediatek/lvts_thermal.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index 1e11defe4f35..b693fac2d677 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -998,8 +998,7 @@ static int lvts_ctrl_start(struct device *dev, struct lvts_ctrl *lvts_ctrl)
return PTR_ERR(tz);
}
- if (devm_thermal_add_hwmon_sysfs(dev, tz))
- dev_warn(dev, "zone %d: Failed to add hwmon sysfs attributes\n", dt_id);
+ devm_thermal_add_hwmon_sysfs(dev, tz);
/*
* The thermal zone pointer will be needed in the
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 11/12] thermal/drivers/generic-adc: Register thermal zones as hwmon sensors
2023-06-13 11:48 [PATCH v3 01/12] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Yangtao Li
` (8 preceding siblings ...)
2023-06-13 11:49 ` [PATCH v3 10/12] thermal/drivers/mediatek/lvts_thermal: " Yangtao Li
@ 2023-06-13 11:49 ` Yangtao Li
2023-06-19 15:17 ` Matthias Brugger
2023-06-13 11:49 ` [PATCH v3 12/12] thermal/drivers/generic-adc: remove redundant msg in gadc_thermal_probe() Yangtao Li
10 siblings, 1 reply; 16+ messages in thread
From: Yangtao Li @ 2023-06-13 11:49 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
From: Chen-Yu Tsai <wenst@chromium.org>
Register thermal zones as hwmon sensors to let userspace read
temperatures using standard hwmon interface.
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
[Yangtao change to use dev_warn and remove return]
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/thermal-generic-adc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c
index 017b0ce52122..9531bc2f2ce7 100644
--- a/drivers/thermal/thermal-generic-adc.c
+++ b/drivers/thermal/thermal-generic-adc.c
@@ -13,6 +13,8 @@
#include <linux/slab.h>
#include <linux/thermal.h>
+#include "thermal_hwmon.h"
+
struct gadc_thermal_info {
struct device *dev;
struct thermal_zone_device *tz_dev;
@@ -153,6 +155,9 @@ static int gadc_thermal_probe(struct platform_device *pdev)
return ret;
}
+ if (devm_thermal_add_hwmon_sysfs(&pdev->dev, gti->tz_dev))
+ dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n");
+
return 0;
}
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 12/12] thermal/drivers/generic-adc: remove redundant msg in gadc_thermal_probe()
2023-06-13 11:48 [PATCH v3 01/12] thermal/hwmon: Add error information printing for devm_thermal_add_hwmon_sysfs() Yangtao Li
` (9 preceding siblings ...)
2023-06-13 11:49 ` [PATCH v3 11/12] thermal/drivers/generic-adc: Register thermal zones as hwmon sensors Yangtao Li
@ 2023-06-13 11:49 ` Yangtao Li
10 siblings, 0 replies; 16+ messages in thread
From: Yangtao Li @ 2023-06-13 11:49 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
The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
print error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/thermal/thermal-generic-adc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c
index 9531bc2f2ce7..f4f1a04f8c0f 100644
--- a/drivers/thermal/thermal-generic-adc.c
+++ b/drivers/thermal/thermal-generic-adc.c
@@ -155,8 +155,7 @@ static int gadc_thermal_probe(struct platform_device *pdev)
return ret;
}
- if (devm_thermal_add_hwmon_sysfs(&pdev->dev, gti->tz_dev))
- dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n");
+ devm_thermal_add_hwmon_sysfs(&pdev->dev, gti->tz_dev);
return 0;
}
--
2.39.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v3 08/12] thermal/drivers/ti-soc: remove redundant msg in ti_thermal_expose_sensor()
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
0 siblings, 0 replies; 16+ messages in thread
From: J, KEERTHY @ 2023-06-13 12:55 UTC (permalink / raw)
To: Yangtao Li, 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,
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
On 6/13/2023 5:19 PM, Yangtao Li wrote:
> The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
> print error information.
Acked-by: Keerthy <j-keerthy@ti.com>
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> index 6a5335931f4d..d414a4b7a94a 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> @@ -182,8 +182,7 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
> ti_bandgap_write_update_interval(bgp, data->sensor_id,
> TI_BANDGAP_UPDATE_INTERVAL_MS);
>
> - if (devm_thermal_add_hwmon_sysfs(bgp->dev, data->ti_thermal))
> - dev_warn(bgp->dev, "failed to add hwmon sysfs attributes\n");
> + devm_thermal_add_hwmon_sysfs(bgp->dev, data->ti_thermal); >
> return 0;
> }
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 02/12] thermal/drivers/sun8i: remove redundant msg in sun8i_ths_register()
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
0 siblings, 0 replies; 16+ messages in thread
From: Jernej Škrabec @ 2023-06-18 5:55 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, samuel,
thierry.reding, jonathanh, edubezval, j-keerthy, matthias.bgg,
angelogioacchino.delregno, bchihi, niklas.soderlund+renesas,
wenst, Yangtao Li
Cc: linux-pm, linux-amlogic, linux-kernel, linux-arm-kernel,
linux-arm-msm, linux-sunxi, linux-tegra, linux-omap,
linux-mediatek, Yangtao Li
Dne torek, 13. junij 2023 ob 13:48:54 CEST je Yangtao Li napisal(a):
> The upper-layer devm_thermal_add_hwmon_sysfs() function can directly
> print error information.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/thermal/sun8i_thermal.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c
> index 793ddce72132..066f9fed9b86 100644
> --- a/drivers/thermal/sun8i_thermal.c
> +++ b/drivers/thermal/sun8i_thermal.c
> @@ -475,9 +475,7 @@ static int sun8i_ths_register(struct ths_device *tmdev)
> if (IS_ERR(tmdev->sensor[i].tzd))
> return PTR_ERR(tmdev->sensor[i].tzd);
>
> - if (devm_thermal_add_hwmon_sysfs(tmdev->dev, tmdev->sensor[i].tzd))
> - dev_warn(tmdev->dev,
> - "Failed to add hwmon sysfs attributes\n");
> + devm_thermal_add_hwmon_sysfs(tmdev->dev, tmdev->sensor[i].tzd);
> }
>
> return 0;
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 11/12] thermal/drivers/generic-adc: Register thermal zones as hwmon sensors
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
0 siblings, 1 reply; 16+ messages in thread
From: Matthias Brugger @ 2023-06-19 15:17 UTC (permalink / raw)
To: Yangtao Li, 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, 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
On 13/06/2023 13:49, Yangtao Li wrote:
> From: Chen-Yu Tsai <wenst@chromium.org>
>
> Register thermal zones as hwmon sensors to let userspace read
> temperatures using standard hwmon interface.
>
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> [Yangtao change to use dev_warn and remove return]
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/thermal/thermal-generic-adc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c
> index 017b0ce52122..9531bc2f2ce7 100644
> --- a/drivers/thermal/thermal-generic-adc.c
> +++ b/drivers/thermal/thermal-generic-adc.c
> @@ -13,6 +13,8 @@
> #include <linux/slab.h>
> #include <linux/thermal.h>
>
> +#include "thermal_hwmon.h"
> +
> struct gadc_thermal_info {
> struct device *dev;
> struct thermal_zone_device *tz_dev;
> @@ -153,6 +155,9 @@ static int gadc_thermal_probe(struct platform_device *pdev)
> return ret;
> }
>
> + if (devm_thermal_add_hwmon_sysfs(&pdev->dev, gti->tz_dev))
> + dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n");
Isn't that already done by patch 1/12?
Regards,
Matthias
> +
> return 0;
> }
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 11/12] thermal/drivers/generic-adc: Register thermal zones as hwmon sensors
2023-06-19 15:17 ` Matthias Brugger
@ 2023-06-19 15:33 ` Chen-Yu Tsai
0 siblings, 0 replies; 16+ messages in thread
From: Chen-Yu Tsai @ 2023-06-19 15:33 UTC (permalink / raw)
To: Matthias Brugger
Cc: Yangtao Li, glaroque, rafael, daniel.lezcano, amitk, rui.zhang,
shawnguo, s.hauer, kernel, festevam, linux-imx, thara.gopinath,
agross, andersson, konrad.dybcio, anarsoul, tiny.windzz,
jernej.skrabec, samuel, thierry.reding, jonathanh, edubezval,
j-keerthy, angelogioacchino.delregno, bchihi,
niklas.soderlund+renesas, wenst, linux-pm, linux-amlogic,
linux-kernel, linux-arm-kernel, linux-arm-msm, linux-sunxi,
linux-tegra, linux-omap, linux-mediatek
On Mon, Jun 19, 2023 at 11:17 PM Matthias Brugger
<matthias.bgg@gmail.com> wrote:
>
>
>
> On 13/06/2023 13:49, Yangtao Li wrote:
> > From: Chen-Yu Tsai <wenst@chromium.org>
> >
> > Register thermal zones as hwmon sensors to let userspace read
> > temperatures using standard hwmon interface.
> >
> > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> > [Yangtao change to use dev_warn and remove return]
> > Signed-off-by: Yangtao Li <frank.li@vivo.com>
> > ---
> > drivers/thermal/thermal-generic-adc.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c
> > index 017b0ce52122..9531bc2f2ce7 100644
> > --- a/drivers/thermal/thermal-generic-adc.c
> > +++ b/drivers/thermal/thermal-generic-adc.c
> > @@ -13,6 +13,8 @@
> > #include <linux/slab.h>
> > #include <linux/thermal.h>
> >
> > +#include "thermal_hwmon.h"
> > +
> > struct gadc_thermal_info {
> > struct device *dev;
> > struct thermal_zone_device *tz_dev;
> > @@ -153,6 +155,9 @@ static int gadc_thermal_probe(struct platform_device *pdev)
> > return ret;
> > }
> >
> > + if (devm_thermal_add_hwmon_sysfs(&pdev->dev, gti->tz_dev))
> > + dev_warn(&pdev->dev, "Failed to add hwmon sysfs attributes\n");
>
> Isn't that already done by patch 1/12?
I think patch 12 should just be squashed in?
> Regards,
> Matthias
>
> > +
> > return 0;
> > }
> >
^ permalink raw reply [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;
as well as URLs for NNTP newsgroup(s).