summaryrefslogtreecommitdiffstats
path: root/drivers/mux/gpio.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-03-30 21:33:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-02 16:28:53 +0200
commit38ab861493de18c672b101765751f5e6bb17ec0d (patch)
tree344c67dce6393e129b23d7468714605619eb5416 /drivers/mux/gpio.c
parentmux: gpio: Make it OF independent (diff)
downloadlinux-38ab861493de18c672b101765751f5e6bb17ec0d.tar.xz
linux-38ab861493de18c672b101765751f5e6bb17ec0d.zip
mux: gpio: Simplify code by using dev_err_probe()
Use already prepared dev_err_probe() introduced by the commit a787e5400a1c ("driver core: add device probe log helper"). It simplifies EPROBE_DEFER handling. Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210330193325.68362-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mux/gpio.c')
-rw-r--r--drivers/mux/gpio.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/mux/gpio.c b/drivers/mux/gpio.c
index 92cc476c916e..cc5f2c1861d4 100644
--- a/drivers/mux/gpio.c
+++ b/drivers/mux/gpio.c
@@ -66,12 +66,9 @@ static int mux_gpio_probe(struct platform_device *pdev)
mux_chip->ops = &mux_gpio_ops;
mux_gpio->gpios = devm_gpiod_get_array(dev, "mux", GPIOD_OUT_LOW);
- if (IS_ERR(mux_gpio->gpios)) {
- ret = PTR_ERR(mux_gpio->gpios);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "failed to get gpios\n");
- return ret;
- }
+ if (IS_ERR(mux_gpio->gpios))
+ return dev_err_probe(dev, PTR_ERR(mux_gpio->gpios),
+ "failed to get gpios\n");
WARN_ON(pins != mux_gpio->gpios->ndescs);
mux_chip->mux->states = BIT(pins);