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: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0e3e143e5d
commit
cd385e9a2a
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue