2022-09-13 03:46:41

by Yang Yingliang

[permalink] [raw]
Subject: [PATCH -next 2/2] clk: qcom: clk-spmi-pmic-div: Use dev_err_probe() helper

dev_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER.

Signed-off-by: Yang Yingliang <[email protected]>
---
drivers/clk/qcom/clk-spmi-pmic-div.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/qcom/clk-spmi-pmic-div.c b/drivers/clk/qcom/clk-spmi-pmic-div.c
index f2cf55cee2fd..10b8d19d0662 100644
--- a/drivers/clk/qcom/clk-spmi-pmic-div.c
+++ b/drivers/clk/qcom/clk-spmi-pmic-div.c
@@ -237,12 +237,9 @@ static int spmi_pmic_clkdiv_probe(struct platform_device *pdev)
cc->nclks = nclks;

cxo = clk_get(dev, "xo");
- if (IS_ERR(cxo)) {
- ret = PTR_ERR(cxo);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "failed to get xo clock\n");
- return ret;
- }
+ if (IS_ERR(cxo))
+ return dev_err_probe(dev, PTR_ERR(cxo),
+ "failed to get xo clock\n");
cxo_hz = clk_get_rate(cxo);
clk_put(cxo);

--
2.25.1


2022-10-17 21:39:20

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH -next 2/2] clk: qcom: clk-spmi-pmic-div: Use dev_err_probe() helper

Quoting Yang Yingliang (2022-09-12 20:17:56)
> dev_err() can be replace with dev_err_probe() which will check if error
> code is -EPROBE_DEFER.
>
> Signed-off-by: Yang Yingliang <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>