Skip to contentSkip to conversation

thermal: qcom-spmi-adc-tm5: suppress probe-deferral error message

PATCH Applied Johan Hovold 6 participants 6 messages Nov 2, 2022 – Dec 9, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: qcom-spmi-adc-tm5: suppress probe-deferral error message

Drivers should not be logging errors on probe deferral. Switch to using dev_err_probe() to log failures when parsing the devicetree to avoid errors like:

	qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: get dt data failed: -517

when a channel is not yet available.

---
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/thermal/qcom/qcom-spmi-adc-tm5.c +2 -4
index a3310bf061cb..c70615d2d771 100644
@@ -1031,10 +1031,8 @@ static int adc_tm5_probe(struct platform_device *pdev)
 		return irq;
 
 	ret = adc_tm5_get_dt_data(adc_tm, node);
-	if (ret) {
-		dev_err(dev, "get dt data failed: %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "get dt data failed\n");
 
 	ret = adc_tm->data->init(adc_tm);
 	if (ret) {
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Johan Hovold

Drivers should not be logging errors on probe deferral. Switch to using dev_err_probe() to log failures when parsing the devicetree to avoid errors like:

	qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: get dt data failed: -517

when a channel is not yet available.

Quoted 24 lines
---
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/thermal/qcom/qcom-spmi-adc-tm5.c +2 -4
index a3310bf061cb..c70615d2d771 100644
@@ -1031,10 +1031,8 @@ static int adc_tm5_probe(struct platform_device *pdev)
 		return irq;
 
 	ret = adc_tm5_get_dt_data(adc_tm, node);
-	if (ret) {
-		dev_err(dev, "get dt data failed: %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "get dt data failed\n");
 
 	ret = adc_tm->data->init(adc_tm);
 	if (ret) {
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#2 lore raw
In reply to Johan Hovold
Quoted 9 lines · Johan Hovold

Drivers should not be logging errors on probe deferral. Switch to using dev_err_probe() to log failures when parsing the devicetree to avoid errors like:

	qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: get dt data failed: -517

when a channel is not yet available.

I did send a patch earlier for fixing this same issue but I did not use dev_err_probe(). So yours is better.

Thanks,
Mani

Quoted 24 lines
---
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/thermal/qcom/qcom-spmi-adc-tm5.c +2 -4
index a3310bf061cb..c70615d2d771 100644
@@ -1031,10 +1031,8 @@ static int adc_tm5_probe(struct platform_device *pdev)
 		return irq;
 
 	ret = adc_tm5_get_dt_data(adc_tm, node);
-	if (ret) {
-		dev_err(dev, "get dt data failed: %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "get dt data failed\n");
 
 	ret = adc_tm->data->init(adc_tm);
 	if (ret) {
Signature · 1 line
2.37.3
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#3 lore raw
In reply to Johan Hovold
Quoted 20 lines · Johan Hovold

Drivers should not be logging errors on probe deferral. Switch to using dev_err_probe() to log failures when parsing the devicetree to avoid errors like:

	qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: get dt data failed: -517

when a channel is not yet available.

---
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/thermal/qcom/qcom-spmi-adc-tm5.c +0 -0
index a3310bf061cb..c70615d2d771 100644
@@ -1031,10 +1031,8 @@ static int adc_tm5_probe(struct platform_device *pdev)
 		return irq;
 

drivers/thermal/qcom/qcom-spmi-adc-tm5.c static int adc_tm5_probe(struct platform_device *pdev) · line 1038

Quoted 10 lines
drivers/thermal/qcom/qcom-spmi-adc-tm5.c +2 -4
 	ret = adc_tm5_get_dt_data(adc_tm, node);
-	if (ret) {
-		dev_err(dev, "get dt data failed: %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "get dt data failed\n");
 
 	ret = adc_tm->data->init(adc_tm);
 	if (ret) {

Daniel, I noticed this one hasn't been picked up yet (at least it's not in linux-next). Is this something you can do?

Johan

#4 lore raw
In reply to Johan Hovold
Quoted 10 lines · Johan Hovold

Drivers should not be logging errors on probe deferral. Switch to using dev_err_probe() to log failures when parsing the devicetree to avoid errors like:

	qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: get dt data failed: -517

when a channel is not yet available.

---

Applied, thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#5 lore raw
In reply to Johan Hovold
The following commit has been merged into the thermal/next branch of thermal:

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     807efb7102e8d22b61cd400495f9478a110badd2
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//807efb7102e8d22b61cd400495f9478a110badd2
Author:        Johan Hovold <[email protected]>
AuthorDate:    Wed, 02 Nov 2022 16:26:30 +01:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Thu, 08 Dec 2022 14:30:44 +01:00

thermal: qcom-spmi-adc-tm5: suppress probe-deferral error message

Drivers should not be logging errors on probe deferral. Switch to using dev_err_probe() to log failures when parsing the devicetree to avoid errors like:

	qcom-spmi-adc-tm5 c440000.spmi:pmic@0:adc-tm@3400: get dt data failed: -517

when a channel is not yet available.

---
 drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/thermal/qcom/qcom-spmi-adc-tm5.c +2 -4
index 1b2c43e..88462a4 100644
@@ -1030,10 +1030,8 @@ static int adc_tm5_probe(struct platform_device *pdev)
 		return irq;
 
 	ret = adc_tm5_get_dt_data(adc_tm, node);
-	if (ret) {
-		dev_err(dev, "get dt data failed: %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "get dt data failed\n");
 
 	ret = adc_tm->data->init(adc_tm);
 	if (ret) {