All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Petr Mladek <pmladek@suse.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	linux-serial@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [PATCH v1 5/6] console: Propagate error code from console ->setup()
Date: Thu, 18 Jun 2020 19:47:50 +0300	[thread overview]
Message-ID: <20200618164751.56828-6-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20200618164751.56828-1-andriy.shevchenko@linux.intel.com>

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>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 kernel/printk/printk.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 8c14835be46c..aaea3ad182e1 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -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];
@@ -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) {
-- 
2.27.0


  parent reply	other threads:[~2020-06-18 16:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 16:47 [PATCH v1 0/6] console: unify return codes from ->setup() hook Andy Shevchenko
2020-06-18 16:47 ` [PATCH v1 1/6] mips: Return proper error code from console " Andy Shevchenko
2020-06-19  8:37   ` Thomas Bogendoerfer
2020-06-22  4:50   ` Jiri Slaby
2020-06-22 14:36     ` Andy Shevchenko
2020-06-18 16:47 ` [PATCH v1 2/6] serial: sunsab: " Andy Shevchenko
2020-06-19  2:50   ` David Miller
2020-06-18 16:47 ` [PATCH v1 3/6] serial: sunzilog: " Andy Shevchenko
2020-06-19  2:50   ` David Miller
2020-06-18 16:47 ` [PATCH v1 4/6] tty: hvc: " Andy Shevchenko
2020-06-18 16:47 ` Andy Shevchenko [this message]
2020-06-19  3:17   ` [PATCH v1 5/6] console: Propagate error code from console ->setup() Benjamin Herrenschmidt
2020-06-18 16:47 ` [PATCH v1 6/6] console: Fix trivia typo 'change' -> 'chance' Andy Shevchenko
2020-06-19  3:17   ` Benjamin Herrenschmidt
2020-06-19  2:28 ` [PATCH v1 0/6] console: unify return codes from ->setup() hook Sergey Senozhatsky
2020-06-19  9:39 ` Petr Mladek
2020-06-19  9:47   ` Andy Shevchenko
2020-06-19 10:21     ` Sergey Senozhatsky
2020-06-19 11:26       ` Petr Mladek
2020-06-19 17:25         ` Sergey Senozhatsky
2020-06-25 13:41 ` Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200618164751.56828-6-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.