linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 04/10] clk: gpio: Simplify with dev_err_probe()
Date: Wed,  2 Sep 2020 17:03:42 +0200	[thread overview]
Message-ID: <20200902150348.14465-4-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/clk-gpio.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
index 38755a241ab7..a3cc53edcb11 100644
--- a/drivers/clk/clk-gpio.c
+++ b/drivers/clk/clk-gpio.c
@@ -199,7 +199,6 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
 	struct gpio_desc *gpiod;
 	struct clk_hw *hw;
 	bool is_mux;
-	int ret;
 
 	is_mux = of_device_is_compatible(node, "gpio-mux-clock");
 
@@ -211,17 +210,10 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
 
 	gpio_name = is_mux ? "select" : "enable";
 	gpiod = devm_gpiod_get(dev, gpio_name, GPIOD_OUT_LOW);
-	if (IS_ERR(gpiod)) {
-		ret = PTR_ERR(gpiod);
-		if (ret == -EPROBE_DEFER)
-			pr_debug("%pOFn: %s: GPIOs not yet available, retry later\n",
-					node, __func__);
-		else
-			pr_err("%pOFn: %s: Can't get '%s' named GPIO property\n",
-					node, __func__,
-					gpio_name);
-		return ret;
-	}
+	if (IS_ERR(gpiod))
+		return dev_err_probe(dev, PTR_ERR(gpiod),
+				     "%pOFn: Can't get '%s' named GPIO property\n",
+				     node, gpio_name);
 
 	if (is_mux)
 		hw = clk_hw_register_gpio_mux(dev, gpiod);
-- 
2.17.1


  parent reply	other threads:[~2020-09-02 15:36 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 ` Krzysztof Kozlowski [this message]
2020-09-10 22:01   ` [PATCH 04/10] clk: gpio: " 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 ` [PATCH 08/10] clk: qcom: " Krzysztof Kozlowski
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-4-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).