Skip to content

Commit

Permalink
Merge branch 'for-5.9-console-return-codes' into for-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Mladek committed Aug 4, 2020
2 parents 30d497a + 6f2fdb2 commit 57e60db
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion arch/mips/fw/arc/arc_con.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ static void prom_console_write(struct console *co, const char *s,

static int prom_console_setup(struct console *co, char *options)
{
return !(prom_flags & PROM_FLAG_USE_AS_CONSOLE);
if (prom_flags & PROM_FLAG_USE_AS_CONSOLE)
return 0;
return -ENODEV;
}

static struct console arc_cons = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/tty/hvc/hvc_xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ static void xen_hvm_early_write(uint32_t vtermno, const char *str, int len) { }
#endif

#ifdef CONFIG_EARLY_PRINTK
static int __init xenboot_setup_console(struct console *console, char *string)
static int __init xenboot_console_setup(struct console *console, char *string)
{
static struct xencons_info xenboot;

Expand Down Expand Up @@ -647,7 +647,7 @@ static void xenboot_write_console(struct console *console, const char *string,
struct console xenboot_console = {
.name = "xenboot",
.write = xenboot_write_console,
.setup = xenboot_setup_console,
.setup = xenboot_console_setup,
.flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
.index = -1,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/hvc/hvsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ static int __init hvsi_console_setup(struct console *console, char *options)
int ret;

if (console->index < 0 || console->index >= hvsi_count)
return -1;
return -EINVAL;
hp = &hvsi_ports[console->index];

/* give the FSP a chance to change the baud rate when we re-open */
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/sunsab.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ static int sunsab_console_setup(struct console *con, char *options)
* though...
*/
if (up->port.type != PORT_SUNSAB)
return -1;
return -EINVAL;

printk("Console: ttyS%d (SAB82532)\n",
(sunsab_reg.minor - 64) + con->index);
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/sunzilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options)
int baud, brg;

if (up->port.type != PORT_SUNZILOG)
return -1;
return -EINVAL;

printk(KERN_INFO "Console: ttyS%d (SunZilog zs%d)\n",
(sunzilog_reg.minor - 64) + con->index, con->index);
Expand Down
8 changes: 4 additions & 4 deletions kernel/printk/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2676,7 +2676,7 @@ early_param("keep_bootcon", keep_bootcon_setup);
static int try_enable_new_console(struct console *newcon, bool user_specified)
{
struct console_cmdline *c;
int i;
int i, err;

for (i = 0, c = console_cmdline;
i < MAX_CMDLINECONSOLES && c->name[0];
Expand All @@ -2699,8 +2699,8 @@ static int try_enable_new_console(struct console *newcon, bool user_specified)
return 0;

if (newcon->setup &&
newcon->setup(newcon, c->options) != 0)
return -EIO;
(err = newcon->setup(newcon, c->options)) != 0)
return err;
}
newcon->flags |= CON_ENABLED;
if (i == preferred_console) {
Expand All @@ -2713,7 +2713,7 @@ static int try_enable_new_console(struct console *newcon, bool user_specified)
/*
* Some consoles, such as pstore and netconsole, can be enabled even
* without matching. Accept the pre-enabled consoles only when match()
* and setup() had a change to be called.
* and setup() had a chance to be called.
*/
if (newcon->flags & CON_ENABLED && c->user_specified == user_specified)
return 0;
Expand Down

0 comments on commit 57e60db

Please sign in to comment.