summaryrefslogtreecommitdiffstats
path: root/kernel/printk
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2017-03-26 16:47:36 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-31 09:29:06 -0400
commit2ed2b8621be2708c0f6d61fe9841e9ad8b9753f0 (patch)
tree341e078fa6625fecaea9710cd303630b2bfde4da /kernel/printk
parentcfa6eb239154315e6efcdda1d929e024097f927b (diff)
braille-console: Fix value returned by _braille_console_setup
commit bbeddf52adc1 ("printk: move braille console support into separate braille.[ch] files") introduced _braille_console_setup() to outline the braille initialization code. There was however some confusion over the value it was supposed to return. commit 2cfe6c4ac7ee ("printk: Fix return of braille_register_console()") tried to fix it but failed to. This fixes and documents the returned value according to the use in printk.c: non-zero return means a parsing error, and thus this console configuration should be ignored. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Cc: Aleksey Makarov <aleksey.makarov@linaro.org> Cc: Joe Perches <joe@perches.com> Cc: Ming Lei <ming.lei@canonical.com> Cc: Steven Rostedt <rostedt@goodmis.org> Acked-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/printk')
-rw-r--r--kernel/printk/braille.c15
-rw-r--r--kernel/printk/braille.h13
2 files changed, 18 insertions, 10 deletions
diff --git a/kernel/printk/braille.c b/kernel/printk/braille.c
index d5760c42f042..61d41ca41844 100644
--- a/kernel/printk/braille.c
+++ b/kernel/printk/braille.c
@@ -2,12 +2,13 @@
2 2
3#include <linux/kernel.h> 3#include <linux/kernel.h>
4#include <linux/console.h> 4#include <linux/console.h>
5#include <linux/errno.h>
5#include <linux/string.h> 6#include <linux/string.h>
6 7
7#include "console_cmdline.h" 8#include "console_cmdline.h"
8#include "braille.h" 9#include "braille.h"
9 10
10char *_braille_console_setup(char **str, char **brl_options) 11int _braille_console_setup(char **str, char **brl_options)
11{ 12{
12 if (!strncmp(*str, "brl,", 4)) { 13 if (!strncmp(*str, "brl,", 4)) {
13 *brl_options = ""; 14 *brl_options = "";
@@ -15,14 +16,14 @@ char *_braille_console_setup(char **str, char **brl_options)
15 } else if (!strncmp(*str, "brl=", 4)) { 16 } else if (!strncmp(*str, "brl=", 4)) {
16 *brl_options = *str + 4; 17 *brl_options = *str + 4;
17 *str = strchr(*brl_options, ','); 18 *str = strchr(*brl_options, ',');
18 if (!*str) 19 if (!*str) {
19 pr_err("need port name after brl=\n"); 20 pr_err("need port name after brl=\n");
20 else 21 return -EINVAL;
21 *((*str)++) = 0; 22 }
22 } else 23 *((*str)++) = 0;
23 return NULL; 24 }
24 25
25 return *str; 26 return 0;
26} 27}
27 28
28int 29int
diff --git a/kernel/printk/braille.h b/kernel/printk/braille.h
index 769d771145c8..749a6756843a 100644
--- a/kernel/printk/braille.h
+++ b/kernel/printk/braille.h
@@ -9,7 +9,14 @@ braille_set_options(struct console_cmdline *c, char *brl_options)
9 c->brl_options = brl_options; 9 c->brl_options = brl_options;
10} 10}
11 11
12char * 12/*
13 * Setup console according to braille options.
14 * Return -EINVAL on syntax error, 0 on success (or no braille option was
15 * actually given).
16 * Modifies str to point to the serial options
17 * Sets brl_options to the parsed braille options.
18 */
19int
13_braille_console_setup(char **str, char **brl_options); 20_braille_console_setup(char **str, char **brl_options);
14 21
15int 22int
@@ -25,10 +32,10 @@ braille_set_options(struct console_cmdline *c, char *brl_options)
25{ 32{
26} 33}
27 34
28static inline char * 35static inline int
29_braille_console_setup(char **str, char **brl_options) 36_braille_console_setup(char **str, char **brl_options)
30{ 37{
31 return NULL; 38 return 0;
32} 39}
33 40
34static inline int 41static inline int