diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-12-27 00:21:05 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-09 10:46:26 -0500 |
commit | b9820a31691b771db37afe2054dd3d3a680c1eed (patch) | |
tree | adfb3e449d2f05d71a1358c5d48265f062c5431e | |
parent | 38b1f0fb42f772b8c9aac53593883a18ff5eb9d7 (diff) |
serial: 8250_of: fix return code when probe function fails to get reset
The error pointer from devm_reset_control_get_optional_shared() is
not propagated.
One of the most common problem scenarios is it returns -EPROBE_DEFER
when the reset controller has not probed yet. In this case, the
probe of the reset consumer should be deferred.
Fixes: e2860e1f62f2 ("serial: 8250_of: Add reset support")
Cc: stable@vger.kernel.org # v4.13+
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/8250/8250_of.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 1e67a7e4a5fd..160b8906d9b9 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c | |||
@@ -136,8 +136,11 @@ static int of_platform_serial_setup(struct platform_device *ofdev, | |||
136 | } | 136 | } |
137 | 137 | ||
138 | info->rst = devm_reset_control_get_optional_shared(&ofdev->dev, NULL); | 138 | info->rst = devm_reset_control_get_optional_shared(&ofdev->dev, NULL); |
139 | if (IS_ERR(info->rst)) | 139 | if (IS_ERR(info->rst)) { |
140 | ret = PTR_ERR(info->rst); | ||
140 | goto err_dispose; | 141 | goto err_dispose; |
142 | } | ||
143 | |||
141 | ret = reset_control_deassert(info->rst); | 144 | ret = reset_control_deassert(info->rst); |
142 | if (ret) | 145 | if (ret) |
143 | goto err_dispose; | 146 | goto err_dispose; |