提交 b9820a31 编写于 作者: M Masahiro Yamada 提交者: Greg Kroah-Hartman

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: e2860e1f ("serial: 8250_of: Add reset support")
Cc: stable@vger.kernel.org # v4.13+
Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: NPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 38b1f0fb
......@@ -136,8 +136,11 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
}
info->rst = devm_reset_control_get_optional_shared(&ofdev->dev, NULL);
if (IS_ERR(info->rst))
if (IS_ERR(info->rst)) {
ret = PTR_ERR(info->rst);
goto err_dispose;
}
ret = reset_control_deassert(info->rst);
if (ret)
goto err_dispose;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册