@@ -77,12 +77,9 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev)
a53cc->parent_map = gpll0_a53cc_map;
a53cc->pclk = devm_clk_get(parent, NULL);
- if (IS_ERR(a53cc->pclk)) {
- ret = PTR_ERR(a53cc->pclk);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "failed to get clk: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(a53cc->pclk))
+ return dev_err_probe(dev, PTR_ERR(a53cc->pclk),
+ "failed to get clk\n");
a53cc->clk_nb.notifier_call = a53cc_notifier_cb;
ret = clk_notifier_register(a53cc->pclk, &a53cc->clk_nb);
@@ -237,12 +237,10 @@ 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);
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> --- drivers/clk/qcom/apcs-msm8916.c | 9 +++------ drivers/clk/qcom/clk-spmi-pmic-div.c | 10 ++++------ 2 files changed, 7 insertions(+), 12 deletions(-)