Commit 38ab8614 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

mux: gpio: Simplify code by using dev_err_probe()

Use already prepared dev_err_probe() introduced by the commit
a787e540 ("driver core: add device probe log helper").
It simplifies EPROBE_DEFER handling.
Acked-by: default avatarPeter Rosin <peda@axentia.se>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210330193325.68362-3-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7fef54e2
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment