summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorZhang Zekun <zhangzekun11@huawei.com>2024-09-09 20:29:18 +0800
committerBjorn Andersson <andersson@kernel.org>2024-10-29 15:04:31 -0500
commit454381b5236c22ff5995aab5db4f640d34f9ea98 (patch)
tree93b17fab095d631b350ee03690ed038bc845d3e3 /drivers
parente81ee454d7650e971c9cf38cdfb3c20186ff505d (diff)
downloadlwn-454381b5236c22ff5995aab5db4f640d34f9ea98.tar.gz
lwn-454381b5236c22ff5995aab5db4f640d34f9ea98.zip
soc: qcom: rpmh-rsc: Simplify code with dev_err_probe()
Use dev_err_probe() directly in the driver probe phase, and we don't need to judge if the error code is not equal to -EPROBE_DEFER. This can simplify the code a bit. Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> Link: https://lore.kernel.org/r/20240909122921.12627-2-zhangzekun11@huawei.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/soc/qcom/rpmh-rsc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index de86009ecd91..cb82e887b51d 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -1045,12 +1045,9 @@ static int rpmh_rsc_probe(struct platform_device *pdev)
* do. To avoid adding this check to our children we'll do it now.
*/
ret = cmd_db_ready();
- if (ret) {
- if (ret != -EPROBE_DEFER)
- dev_err(&pdev->dev, "Command DB not available (%d)\n",
- ret);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret,
+ "Command DB not available\n");
drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
if (!drv)