From: Krzysztof Kozlowski <krzk@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Ludovic Desroches <ludovic.desroches@microchip.com>,
David Lechner <david@lechnology.com>,
Sekhar Nori <nsekhar@ti.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
Neil Armstrong <narmstrong@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Kevin Hilman <khilman@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org,
linux-arm-msm@vger.kernel.org
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Subject: [PATCH 08/10] clk: qcom: Simplify with dev_err_probe()
Date: Wed, 2 Sep 2020 17:03:46 +0200 [thread overview]
Message-ID: <20200902150348.14465-8-krzk@kernel.org> (raw)
In-Reply-To: <20200902150348.14465-1-krzk@kernel.org>
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(-)
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
next prev parent reply other threads:[~2020-09-02 15:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-02 15:03 [PATCH 01/10] clk: at91: Drop unused at91sam9g45_pcr_layout Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 02/10] clk: fixed: Add missing kerneldoc Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 03/10] clk: bulk: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 04/10] clk: gpio: " Krzysztof Kozlowski
2020-09-10 22:01 ` Stephen Boyd
2020-09-11 15:29 ` Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 05/10] clk: sunxi-ng: " Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 06/10] clk: keystone: " Krzysztof Kozlowski
2020-09-02 15:03 ` [PATCH 07/10] clk: meson: " Krzysztof Kozlowski
2020-09-07 8:30 ` Jerome Brunet
2020-09-02 15:03 ` Krzysztof Kozlowski [this message]
2020-09-02 15:03 ` [PATCH 09/10] clk: davinci: Add missing kerneldoc Krzysztof Kozlowski
2020-09-02 15:37 ` David Lechner
2020-09-02 15:03 ` [PATCH 10/10] clk: davinci: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-02 15:37 ` David Lechner
2020-09-02 16:35 ` [PATCH 01/10] clk: at91: Drop unused at91sam9g45_pcr_layout Alexandre Belloni
2020-09-11 15:34 ` Krzysztof Kozlowski
2020-09-15 0:01 ` Stephen Boyd
2020-09-16 16:15 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200902150348.14465-8-krzk@kernel.org \
--to=krzk@kernel.org \
--cc=agross@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=bjorn.andersson@linaro.org \
--cc=david@lechnology.com \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=narmstrong@baylibre.com \
--cc=nicolas.ferre@microchip.com \
--cc=nsekhar@ti.com \
--cc=sboyd@kernel.org \
--cc=ssantosh@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).