Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH v1] soc: qcom: pbs: Simplify with dev_err_probe()
@ 2024-08-29 12:48 Yu Jiaoliang
  2024-08-29 23:48 ` Konrad Dybcio
  2024-08-30  8:08 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 10+ messages in thread
From: Yu Jiaoliang @ 2024-08-29 12:48 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, linux-arm-msm, linux-kernel
  Cc: opensource.kernel

Error handling in probe() can be a bit simpler with dev_err_probe().

Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com>
---
 drivers/soc/qcom/qcom-pbs.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/qcom/qcom-pbs.c b/drivers/soc/qcom/qcom-pbs.c
index 77a70d3d0d0b..ab9de12ec901 100644
--- a/drivers/soc/qcom/qcom-pbs.c
+++ b/drivers/soc/qcom/qcom-pbs.c
@@ -201,10 +201,9 @@ static int qcom_pbs_probe(struct platform_device *pdev)
 	}
 
 	ret = device_property_read_u32(pbs->dev, "reg", &val);
-	if (ret < 0) {
-		dev_err(pbs->dev, "Couldn't find reg, ret = %d\n", ret);
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(pbs->dev, ret, "Couldn't find reg\n");
+
 	pbs->base = val;
 	mutex_init(&pbs->lock);
 
-- 
2.34.1


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

end of thread, other threads:[~2024-09-05 12:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-29 12:48 [PATCH v1] soc: qcom: pbs: Simplify with dev_err_probe() Yu Jiaoliang
2024-08-29 23:48 ` Konrad Dybcio
2024-08-30  8:08 ` Krzysztof Kozlowski
2024-08-30 10:03   ` Konrad Dybcio
2024-08-30 15:19     ` Dan Carpenter
2024-08-30 15:31       ` Konrad Dybcio
2024-09-04 18:55         ` Dan Carpenter
2024-09-05 12:35           ` Konrad Dybcio
2024-08-30 10:52   ` 于佼良
2024-08-30 10:57     ` Krzysztof Kozlowski

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