]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - kernel/printk/printk.c
Merge branch 'for-5.11-null-console' into for-linus
[thirdparty/linux.git] / kernel / printk / printk.c
index c8847ee571f0e1f22b022ceb99835e5813ac2702..ccbdac579bd0871c59c408e8dede694935aceb76 100644 (file)
@@ -2236,8 +2236,15 @@ static int __init console_setup(char *str)
        char *s, *options, *brl_options = NULL;
        int idx;
 
-       if (str[0] == 0)
+       /*
+        * console="" or console=null have been suggested as a way to
+        * disable console output. Use ttynull that has been created
+        * for exacly this purpose.
+        */
+       if (str[0] == 0 || strcmp(str, "null") == 0) {
+               __add_preferred_console("ttynull", 0, NULL, NULL, true);
                return 1;
+       }
 
        if (_braille_console_setup(&str, &brl_options))
                return 1;