提交 cd385e9a 编写于 作者: P Peter Hurley 提交者: Greg Kroah-Hartman

serial: 8250_early: Fix setup() error code

If parsing failed to decode a valid uart addr, return -ENODEV instead
of success. Although setup_earlycon() will detect the failure anyway
(because the write() method has not been set), that behavior is not
obvious and should not be relied on.
Acked-by: NRob Herring <robh@kernel.org>
Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 0e3e143e
...@@ -146,7 +146,7 @@ static int __init early_serial8250_setup(struct earlycon_device *device, ...@@ -146,7 +146,7 @@ static int __init early_serial8250_setup(struct earlycon_device *device,
const char *options) const char *options)
{ {
if (!(device->port.membase || device->port.iobase)) if (!(device->port.membase || device->port.iobase))
return 0; return -ENODEV;
if (!device->baud) { if (!device->baud) {
struct uart_port *port = &device->port; struct uart_port *port = &device->port;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册