Skip to content

Commit 38ab861

Browse files
andy-shevgregkh
authored andcommitted
mux: gpio: Simplify code by using dev_err_probe()
Use already prepared dev_err_probe() introduced by the commit a787e54 ("driver core: add device probe log helper"). It simplifies EPROBE_DEFER handling. Acked-by: Peter Rosin <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7fef54e commit 38ab861

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/mux/gpio.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@ static int mux_gpio_probe(struct platform_device *pdev)
6666
mux_chip->ops = &mux_gpio_ops;
6767

6868
mux_gpio->gpios = devm_gpiod_get_array(dev, "mux", GPIOD_OUT_LOW);
69-
if (IS_ERR(mux_gpio->gpios)) {
70-
ret = PTR_ERR(mux_gpio->gpios);
71-
if (ret != -EPROBE_DEFER)
72-
dev_err(dev, "failed to get gpios\n");
73-
return ret;
74-
}
69+
if (IS_ERR(mux_gpio->gpios))
70+
return dev_err_probe(dev, PTR_ERR(mux_gpio->gpios),
71+
"failed to get gpios\n");
7572
WARN_ON(pins != mux_gpio->gpios->ndescs);
7673
mux_chip->mux->states = BIT(pins);
7774

0 commit comments

Comments
 (0)