From f85956b7a29d39745d16ebb6fb81c663018beab1 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 18 Jun 2020 19:47:47 +0300 Subject: serial: sunsab: Return proper error code from console ->setup() hook For unifying console ->setup() handling, which is poorly documented, return error code, rather than non-zero arbitrary number. Signed-off-by: Andy Shevchenko Reviewed-by: Petr Mladek Acked-by: David S. Miller Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20200618164751.56828-3-andriy.shevchenko@linux.intel.com --- drivers/tty/serial/sunsab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c index 1eb703c980e0..bab551f46963 100644 --- a/drivers/tty/serial/sunsab.c +++ b/drivers/tty/serial/sunsab.c @@ -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); -- cgit v1.2.3 From 8629d2744d888cc31cb0ad14c9f222c14165f75e Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 18 Jun 2020 19:47:48 +0300 Subject: serial: sunzilog: Return proper error code from console ->setup() hook For unifying console ->setup() handling, which is poorly documented, return error code, rather than non-zero arbitrary number. Signed-off-by: Andy Shevchenko Reviewed-by: Petr Mladek Acked-by: David S. Miller Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20200618164751.56828-4-andriy.shevchenko@linux.intel.com --- drivers/tty/serial/sunzilog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c index 103ab8c556e7..7ea06bbc6197 100644 --- a/drivers/tty/serial/sunzilog.c +++ b/drivers/tty/serial/sunzilog.c @@ -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); -- cgit v1.2.3 From 9f02842759d8fa4444cd494f847cbe283e3b5815 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 18 Jun 2020 19:47:49 +0300 Subject: tty: hvc: Return proper error code from console ->setup() hook For unifying console ->setup() handling, which is poorly documented, return error code, rather than non-zero arbitrary number. Signed-off-by: Andy Shevchenko Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20200618164751.56828-5-andriy.shevchenko@linux.intel.com --- drivers/tty/hvc/hvsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c index 66f95f758be0..e8c58f9bd263 100644 --- a/drivers/tty/hvc/hvsi.c +++ b/drivers/tty/hvc/hvsi.c @@ -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 */ -- cgit v1.2.3 From 6f2fdb298bf8e3207d060d57f2565b13d9300d2f Mon Sep 17 00:00:00 2001 From: Sergey Senozhatsky Date: Sat, 20 Jun 2020 02:22:40 +0900 Subject: hvc: unify console setup naming Use the 'common' foo_console_setup() naming scheme. There are 71 foo_console_setup() callbacks and only one foo_setup_console(). Signed-off-by: Sergey Senozhatsky Cc: Andy Shevchenko Cc: Steven Rostedt Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20200619172240.754910-1-sergey.senozhatsky@gmail.com --- drivers/tty/hvc/hvc_xen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index 5ef08905fe05..2a0e51a20e34 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c @@ -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; @@ -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, }; -- cgit v1.2.3