Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[deliverable/linux.git] / drivers / serial / sunsab.c
index 0dbd4df44c05140499f03bbcb8e2d33be236d3fa..cfe20f730436159f92b1422bd082079da595737b 100644 (file)
@@ -886,6 +886,15 @@ static int sunsab_console_setup(struct console *con, char *options)
        unsigned long flags;
        unsigned int baud, quot;
 
+       /*
+        * The console framework calls us for each and every port
+        * registered. Defer the console setup until the requested
+        * port has been properly discovered. A bit of a hack,
+        * though...
+        */
+       if (up->port.type != PORT_SUNSAB)
+               return -1;
+
        printk("Console: ttyS%d (SAB82532)\n",
               (sunsab_reg.minor - 64) + con->index);
 
@@ -1047,12 +1056,13 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id *
        up = &sunsab_ports[inst * 2];
 
        err = sunsab_init_one(&up[0], op,
-                             sizeof(union sab82532_async_regs),
+                             0,
                              (inst * 2) + 0);
        if (err)
                return err;
 
-       err = sunsab_init_one(&up[0], op, 0,
+       err = sunsab_init_one(&up[1], op,
+                             sizeof(union sab82532_async_regs),
                              (inst * 2) + 1);
        if (err) {
                of_iounmap(up[0].port.membase,
@@ -1117,7 +1127,7 @@ static int __init sunsab_init(void)
        int err;
 
        num_channels = 0;
-       for_each_node_by_name(dp, "su")
+       for_each_node_by_name(dp, "se")
                num_channels += 2;
        for_each_node_by_name(dp, "serial") {
                if (of_device_is_compatible(dp, "sab82532"))
This page took 0.026067 seconds and 5 git commands to generate.