[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240829124813.3264437-1-yujiaoliang@vivo.com>
Date: Thu, 29 Aug 2024 20:48:13 +0800
From: Yu Jiaoliang <yujiaoliang@...o.com>
To: Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>,
linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: [PATCH v1] soc: qcom: pbs: Simplify with dev_err_probe()
Error handling in probe() can be a bit simpler with dev_err_probe().
Signed-off-by: Yu Jiaoliang <yujiaoliang@...o.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
Powered by blists - more mailing lists