Merge tag 'printk-for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/printk...
[linux-block.git] / kernel / printk / printk.c
index b71eaf5f5a86375591d480d36bd729b320e141e1..9b75f6bfc3333b9aff77a0f0dc52f5c8e5b67a34 100644 (file)
@@ -943,6 +943,14 @@ out:
        return ret;
 }
 
+/*
+ * Be careful when modifying this function!!!
+ *
+ * Only few operations are supported because the device works only with the
+ * entire variable length messages (records). Non-standard values are
+ * returned in the other cases and has been this way for quite some time.
+ * User space applications might depend on this behavior.
+ */
 static loff_t devkmsg_llseek(struct file *file, loff_t offset, int whence)
 {
        struct devkmsg_user *user = file->private_data;
@@ -2658,7 +2666,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];
@@ -2681,8 +2689,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) {
@@ -2695,7 +2703,7 @@ static int try_enable_new_console(struct console *newcon, bool user_specified)
        /*
         * Some consoles, such as pstore and netconsole, can be enabled even
         * without matching. Accept the pre-enabled consoles only when match()
-        * and setup() had a change to be called.
+        * and setup() had a chance to be called.
         */
        if (newcon->flags & CON_ENABLED && c->user_specified == user_specified)
                return 0;