diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-26 16:49:33 +0200 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2020-09-30 16:24:57 +0100 |
commit | f104563fe08047b18cd3c96b41de0bc9c16739c7 (patch) | |
tree | 9e6933791acb69aeb959c36bc36ff5f12bb1473a /drivers/mfd/madera-core.c | |
parent | ede6b2d1dfc0d6a7b0b3161a2e911d464e28e0ad (diff) | |
download | lwn-f104563fe08047b18cd3c96b41de0bc9c16739c7.tar.gz lwn-f104563fe08047b18cd3c96b41de0bc9c16739c7.zip |
mfd: madera: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/madera-core.c')
-rw-r--r-- | drivers/mfd/madera-core.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/mfd/madera-core.c b/drivers/mfd/madera-core.c index 8a8d733fdce5..4ed6ad8ce002 100644 --- a/drivers/mfd/madera-core.c +++ b/drivers/mfd/madera-core.c @@ -369,19 +369,14 @@ EXPORT_SYMBOL_GPL(madera_of_match); static int madera_get_reset_gpio(struct madera *madera) { struct gpio_desc *reset; - int ret; if (madera->pdata.reset) return 0; reset = devm_gpiod_get_optional(madera->dev, "reset", GPIOD_OUT_LOW); - if (IS_ERR(reset)) { - ret = PTR_ERR(reset); - if (ret != -EPROBE_DEFER) - dev_err(madera->dev, "Failed to request /RESET: %d\n", - ret); - return ret; - } + if (IS_ERR(reset)) + return dev_err_probe(madera->dev, PTR_ERR(reset), + "Failed to request /RESET"); /* * A hard reset is needed for full reset of the chip. We allow running |