Commit f104563f authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Lee Jones

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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent ede6b2d1
...@@ -369,19 +369,14 @@ EXPORT_SYMBOL_GPL(madera_of_match); ...@@ -369,19 +369,14 @@ EXPORT_SYMBOL_GPL(madera_of_match);
static int madera_get_reset_gpio(struct madera *madera) static int madera_get_reset_gpio(struct madera *madera)
{ {
struct gpio_desc *reset; struct gpio_desc *reset;
int ret;
if (madera->pdata.reset) if (madera->pdata.reset)
return 0; return 0;
reset = devm_gpiod_get_optional(madera->dev, "reset", GPIOD_OUT_LOW); reset = devm_gpiod_get_optional(madera->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(reset)) { if (IS_ERR(reset))
ret = PTR_ERR(reset); return dev_err_probe(madera->dev, PTR_ERR(reset),
if (ret != -EPROBE_DEFER) "Failed to request /RESET");
dev_err(madera->dev, "Failed to request /RESET: %d\n",
ret);
return ret;
}
/* /*
* A hard reset is needed for full reset of the chip. We allow running * A hard reset is needed for full reset of the chip. We allow running
......
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