Skip to content

Commit

Permalink
console: Propagate error code from console ->setup()
Browse files Browse the repository at this point in the history
Since console ->setup() hook returns meaningful error codes,
propagate it to the caller of try_enable_new_console().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20200618164751.56828-6-andriy.shevchenko@linux.intel.com
  • Loading branch information
Andy Shevchenko authored and Petr Mladek committed Jun 25, 2020
1 parent 9f02842 commit bba18a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/printk/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,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 @@ -2691,8 +2691,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 Down

0 comments on commit bba18a1

Please sign in to comment.