Skip to content

Commit 57e60db

Browse files
committed
Merge branch 'for-5.9-console-return-codes' into for-linus
2 parents 30d497a + 6f2fdb2 commit 57e60db

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

arch/mips/fw/arc/arc_con.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ static void prom_console_write(struct console *co, const char *s,
2828

2929
static int prom_console_setup(struct console *co, char *options)
3030
{
31-
return !(prom_flags & PROM_FLAG_USE_AS_CONSOLE);
31+
if (prom_flags & PROM_FLAG_USE_AS_CONSOLE)
32+
return 0;
33+
return -ENODEV;
3234
}
3335

3436
static struct console arc_cons = {

drivers/tty/hvc/hvc_xen.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ static void xen_hvm_early_write(uint32_t vtermno, const char *str, int len) { }
603603
#endif
604604

605605
#ifdef CONFIG_EARLY_PRINTK
606-
static int __init xenboot_setup_console(struct console *console, char *string)
606+
static int __init xenboot_console_setup(struct console *console, char *string)
607607
{
608608
static struct xencons_info xenboot;
609609

@@ -647,7 +647,7 @@ static void xenboot_write_console(struct console *console, const char *string,
647647
struct console xenboot_console = {
648648
.name = "xenboot",
649649
.write = xenboot_write_console,
650-
.setup = xenboot_setup_console,
650+
.setup = xenboot_console_setup,
651651
.flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
652652
.index = -1,
653653
};

drivers/tty/hvc/hvsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ static int __init hvsi_console_setup(struct console *console, char *options)
11281128
int ret;
11291129

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

11341134
/* give the FSP a chance to change the baud rate when we re-open */

drivers/tty/serial/sunsab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ static int sunsab_console_setup(struct console *con, char *options)
886886
* though...
887887
*/
888888
if (up->port.type != PORT_SUNSAB)
889-
return -1;
889+
return -EINVAL;
890890

891891
printk("Console: ttyS%d (SAB82532)\n",
892892
(sunsab_reg.minor - 64) + con->index);

drivers/tty/serial/sunzilog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options)
12211221
int baud, brg;
12221222

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

12261226
printk(KERN_INFO "Console: ttyS%d (SunZilog zs%d)\n",
12271227
(sunzilog_reg.minor - 64) + con->index, con->index);

kernel/printk/printk.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2676,7 +2676,7 @@ early_param("keep_bootcon", keep_bootcon_setup);
26762676
static int try_enable_new_console(struct console *newcon, bool user_specified)
26772677
{
26782678
struct console_cmdline *c;
2679-
int i;
2679+
int i, err;
26802680

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

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

0 commit comments

Comments
 (0)