From: Heiko Stuebner <heiko@sntech.de>
To: mturquette@baylibre.com, sboyd@kernel.org
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
linux-clk@vger.kernel.org, heiko@sntech.de,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org
Subject: [PATCH v4 3/5] clk: clk-gpio: use dev_err_probe for gpio-get failure
Date: Fri, 6 Sep 2024 10:25:09 +0200 [thread overview]
Message-ID: <20240906082511.2963890-4-heiko@sntech.de> (raw)
In-Reply-To: <20240906082511.2963890-1-heiko@sntech.de>
This is a real driver and dev_err_probe will hide the distinction between
EPROBE_DEFER and other errors automatically, so there is no need to
open-code this.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
drivers/clk/clk-gpio.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
index 98415782f9a2..cda362a2eca0 100644
--- a/drivers/clk/clk-gpio.c
+++ b/drivers/clk/clk-gpio.c
@@ -200,7 +200,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");
@@ -212,17 +211,9 @@ 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),
+ "Can't get '%s' named GPIO property\n", gpio_name);
if (is_mux)
hw = clk_hw_register_gpio_mux(dev, gpiod);
--
2.43.0
next prev parent reply other threads:[~2024-09-06 8:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-06 8:25 [PATCH v4 0/5] Binding and driver for gated-fixed-clocks Heiko Stuebner
2024-09-06 8:25 ` [PATCH v4 1/5] dt-bindings: clocks: add binding " Heiko Stuebner
2024-10-16 18:26 ` Stephen Boyd
2024-09-06 8:25 ` [PATCH v4 2/5] clk: clk-gpio: update documentation for gpio-gate clock Heiko Stuebner
2024-10-16 18:26 ` Stephen Boyd
2024-09-06 8:25 ` Heiko Stuebner [this message]
2024-10-16 18:26 ` [PATCH v4 3/5] clk: clk-gpio: use dev_err_probe for gpio-get failure Stephen Boyd
2024-09-06 8:25 ` [PATCH v4 4/5] clk: clk-gpio: add driver for gated-fixed-clocks Heiko Stuebner
2024-10-16 18:26 ` Stephen Boyd
2024-09-06 8:25 ` [PATCH v4 5/5] arm64: dts: rockchip: fix the pcie refclock oscillator on Rock 5 ITX Heiko Stuebner
2024-10-13 19:58 ` [PATCH v4 0/5] Binding and driver for gated-fixed-clocks Dragan Simic
2024-10-13 20:27 ` Heiko Stübner
2024-10-22 14:12 ` (subset) " Heiko Stuebner
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=20240906082511.2963890-4-heiko@sntech.de \
--to=heiko@sntech.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.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