[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200902150348.14465-8-krzk@kernel.org>
Date: Wed, 2 Sep 2020 17:03:46 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Ludovic Desroches <ludovic.desroches@...rochip.com>,
David Lechner <david@...hnology.com>,
Sekhar Nori <nsekhar@...com>,
Santosh Shilimkar <ssantosh@...nel.org>,
Neil Armstrong <narmstrong@...libre.com>,
Jerome Brunet <jbrunet@...libre.com>,
Kevin Hilman <khilman@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Maxime Ripard <mripard@...nel.org>,
Chen-Yu Tsai <wens@...e.org>, linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-amlogic@...ts.infradead.org, linux-arm-msm@...r.kernel.org
Cc: Krzysztof Kozlowski <krzk@...nel.org>
Subject: [PATCH 08/10] clk: qcom: Simplify with dev_err_probe()
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@...nel.org>
---
drivers/clk/qcom/apcs-msm8916.c | 9 +++------
drivers/clk/qcom/clk-spmi-pmic-div.c | 10 ++++------
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c
index cf69a97d0439..5e85625b1d02 100644
--- a/drivers/clk/qcom/apcs-msm8916.c
+++ b/drivers/clk/qcom/apcs-msm8916.c
@@ -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);
diff --git a/drivers/clk/qcom/clk-spmi-pmic-div.c b/drivers/clk/qcom/clk-spmi-pmic-div.c
index f2cf55cee2fd..3088050fb016 100644
--- a/drivers/clk/qcom/clk-spmi-pmic-div.c
+++ b/drivers/clk/qcom/clk-spmi-pmic-div.c
@@ -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);
--
2.17.1
Powered by blists - more mailing lists