]> git.karo-electronics.de Git - linux-beck.git/commitdiff
serial: mux: Convert to uart_console_device instead of open-coded
authorAxel Lin <axel.lin@ingics.com>
Sat, 19 Sep 2015 03:43:07 +0000 (11:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Oct 2015 16:44:52 +0000 (17:44 +0100)
The implementation of mux_console_device() is very similar to
uart_console_device(). Setting .data field in mux_console then we can
convert to use uart_console_device().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/mux.c

index dd26511ad8754fa171114c96c18fdd01e4e66d73..8a4be4b73723381a6bcba7b89cb1137ed3b5ac96 100644 (file)
@@ -412,19 +412,14 @@ static int mux_console_setup(struct console *co, char *options)
         return 0;
 }
 
-struct tty_driver *mux_console_device(struct console *co, int *index)
-{
-        *index = co->index;
-       return mux_driver.tty_driver;
-}
-
 static struct console mux_console = {
        .name =         "ttyB",
        .write =        mux_console_write,
-       .device =       mux_console_device,
+       .device =       uart_console_device,
        .setup =        mux_console_setup,
        .flags =        CON_ENABLED | CON_PRINTBUFFER,
        .index =        0,
+       .data =         &mux_driver,
 };
 
 #define MUX_CONSOLE    &mux_console