]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
serial: suncore: Add 'ignore_line' argument to sunserial_console_match().
authorDavid S. Miller <davem@davemloft.net>
Tue, 24 Nov 2009 22:03:34 +0000 (14:03 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 21:44:00 +0000 (13:44 -0800)
[ Upstream commit 4e3533d05b6e5e66d1cda27f6671251c99c62894 ]

This tells the logic to ignore the line match when deciding whether the
device is the OpenFirmware specified console device or not.

This is going to be used in the SU driver for rsc-console detection.

There is probably a better way to handle this, but this is the least
intrusive solution for now which we can validate won't break any other
cases.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/serial/suncore.c
drivers/serial/suncore.h
drivers/serial/sunsab.c
drivers/serial/sunsu.c
drivers/serial/sunzilog.c

index a2d4a19550ab9be4c5fbf99abf93c7e68e248ee1..50d3b5e4ec732f568aa6a13f6e8d8f3d150ab851 100644 (file)
@@ -53,20 +53,21 @@ void sunserial_unregister_minors(struct uart_driver *drv, int count)
 EXPORT_SYMBOL(sunserial_unregister_minors);
 
 int sunserial_console_match(struct console *con, struct device_node *dp,
-                           struct uart_driver *drv, int line)
+                           struct uart_driver *drv, int line, bool ignore_line)
 {
-       int off;
-
        if (!con || of_console_device != dp)
                return 0;
 
-       off = 0;
-       if (of_console_options &&
-           *of_console_options == 'b')
-               off = 1;
+       if (!ignore_line) {
+               int off = 0;
 
-       if ((line & 1) != off)
-               return 0;
+               if (of_console_options &&
+                   *of_console_options == 'b')
+                       off = 1;
+
+               if ((line & 1) != off)
+                       return 0;
+       }
 
        con->index = line;
        drv->cons = con;
index 042668aa602e756f00d8c011dbcc4307c04709ef..cab95b3fbddcf1b78202d35d7310c4522d1a2d8a 100644 (file)
@@ -26,7 +26,7 @@ extern int sunserial_register_minors(struct uart_driver *, int);
 extern void sunserial_unregister_minors(struct uart_driver *, int);
 
 extern int sunserial_console_match(struct console *, struct device_node *,
-                                  struct uart_driver *, int);
+                                  struct uart_driver *, int, bool);
 extern void sunserial_console_termios(struct console *);
 
 #endif /* !(_SERIAL_SUN_H) */
index 50088f957caa4d678ce811a908104297e8367489..2d87d1a9c11c4971744b80347cb0ba3d5ed306f2 100644 (file)
@@ -1027,10 +1027,12 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id *
                goto out1;
 
        sunserial_console_match(SUNSAB_CONSOLE(), op->node,
-                               &sunsab_reg, up[0].port.line);
+                               &sunsab_reg, up[0].port.line,
+                               false);
 
        sunserial_console_match(SUNSAB_CONSOLE(), op->node,
-                               &sunsab_reg, up[1].port.line);
+                               &sunsab_reg, up[1].port.line,
+                               false);
 
        err = uart_add_one_port(&sunsab_reg, &up[0].port);
        if (err)
index e1b477058d71d9c1050cfc499ebbf0fbb4c5970a..911354ef393e45ae111ac7a97348b23a883b1977 100644 (file)
@@ -1468,7 +1468,8 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
        up->port.ops = &sunsu_pops;
 
        sunserial_console_match(SUNSU_CONSOLE(), dp,
-                               &sunsu_reg, up->port.line);
+                               &sunsu_reg, up->port.line,
+                               false);
        err = uart_add_one_port(&sunsu_reg, &up->port);
        if (err)
                goto out_unmap;
index e09d3cebb4fb4d221b12b8b0b022a434ebaee7f4..36eebeac7b84f76487d74418f7e16e200b30789d 100644 (file)
@@ -1416,7 +1416,8 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
 
        if (!keyboard_mouse) {
                if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node,
-                                           &sunzilog_reg, up[0].port.line))
+                                           &sunzilog_reg, up[0].port.line,
+                                           false))
                        up->flags |= SUNZILOG_FLAG_IS_CONS;
                err = uart_add_one_port(&sunzilog_reg, &up[0].port);
                if (err) {
@@ -1425,7 +1426,8 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
                        return err;
                }
                if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node,
-                                           &sunzilog_reg, up[1].port.line))
+                                           &sunzilog_reg, up[1].port.line,
+                                           false))
                        up->flags |= SUNZILOG_FLAG_IS_CONS;
                err = uart_add_one_port(&sunzilog_reg, &up[1].port);
                if (err) {