diff mbox series

[-next,2/2] clk: qcom: clk-spmi-pmic-div: Use dev_err_probe() helper

Message ID 20220913031756.983224-2-yangyingliang@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next,1/2] clk: qcom: apcs-msm8916: Use dev_err_probe() helper | expand

Commit Message

Yang Yingliang Sept. 13, 2022, 3:17 a.m. UTC
dev_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/clk/qcom/clk-spmi-pmic-div.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Stephen Boyd Oct. 17, 2022, 9:11 p.m. UTC | #1
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 <yangyingliang@huawei.com>
> ---

Reviewed-by: Stephen Boyd <sboyd@kernel.org>
diff mbox series

Patch

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);