Skip to content

Commit 36abe81

Browse files
mmindbebarino
authored andcommitted
clk: clk-gpio: use dev_err_probe for gpio-get failure
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 6cb137c commit 36abe81

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

drivers/clk/clk-gpio.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
200200
struct gpio_desc *gpiod;
201201
struct clk_hw *hw;
202202
bool is_mux;
203-
int ret;
204203

205204
is_mux = of_device_is_compatible(node, "gpio-mux-clock");
206205

@@ -212,17 +211,9 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
212211

213212
gpio_name = is_mux ? "select" : "enable";
214213
gpiod = devm_gpiod_get(dev, gpio_name, GPIOD_OUT_LOW);
215-
if (IS_ERR(gpiod)) {
216-
ret = PTR_ERR(gpiod);
217-
if (ret == -EPROBE_DEFER)
218-
pr_debug("%pOFn: %s: GPIOs not yet available, retry later\n",
219-
node, __func__);
220-
else
221-
pr_err("%pOFn: %s: Can't get '%s' named GPIO property\n",
222-
node, __func__,
223-
gpio_name);
224-
return ret;
225-
}
214+
if (IS_ERR(gpiod))
215+
return dev_err_probe(dev, PTR_ERR(gpiod),
216+
"Can't get '%s' named GPIO property\n", gpio_name);
226217

227218
if (is_mux)
228219
hw = clk_hw_register_gpio_mux(dev, gpiod);

0 commit comments

Comments
 (0)