]> Pileus Git - ~andy/linux/blobdiff - drivers/serial/sunsab.c
Driver core: add device_rename function
[~andy/linux] / drivers / serial / sunsab.c
index 141fedbefbc4cd51096b4d8a2569e14722a933d8..cfe20f730436159f92b1422bd082079da595737b 100644 (file)
@@ -15,7 +15,6 @@
  *   David S. Miller <davem@davemloft.net>
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -887,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);
 
@@ -1028,7 +1036,7 @@ static int __devinit sunsab_init_one(struct uart_sunsab_port *up,
                int err;
 
                err = request_irq(up->port.irq, sunsab_interrupt,
-                                 SA_SHIRQ, "sab", up);
+                                 IRQF_SHARED, "sab", up);
                if (err) {
                        of_iounmap(up->port.membase,
                                   sizeof(union sab82532_async_regs));
@@ -1048,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,
@@ -1118,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"))