[PATCH] devfs: Remove devfs support from the serial subsystem
[safe/jmp/linux-2.6] / drivers / serial / sunhv.c
index 378a178..d36bc40 100644 (file)
@@ -210,9 +210,6 @@ static void sunhv_stop_tx(struct uart_port *port)
 static void sunhv_start_tx(struct uart_port *port)
 {
        struct circ_buf *xmit = &port->info->xmit;
-       unsigned long flags;
-
-       spin_lock_irqsave(&port->lock, flags);
 
        while (!uart_circ_empty(xmit)) {
                long status = hypervisor_con_putchar(xmit->buf[xmit->tail]);
@@ -223,8 +220,6 @@ static void sunhv_start_tx(struct uart_port *port)
                xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
                port->icount.tx++;
        }
-
-       spin_unlock_irqrestore(&port->lock, flags);
 }
 
 /* port->lock is not held.  */
@@ -259,7 +254,7 @@ static void sunhv_break_ctl(struct uart_port *port, int break_state)
 {
        if (break_state) {
                unsigned long flags;
-               int limit = 10000;
+               int limit = 1000000;
 
                spin_lock_irqsave(&port->lock, flags);
 
@@ -267,6 +262,7 @@ static void sunhv_break_ctl(struct uart_port *port, int break_state)
                        long status = hypervisor_con_putchar(CON_BREAK);
                        if (status == HV_EOK)
                                break;
+                       udelay(2);
                }
 
                spin_unlock_irqrestore(&port->lock, flags);
@@ -357,7 +353,6 @@ static struct uart_ops sunhv_pops = {
 static struct uart_driver sunhv_reg = {
        .owner                  = THIS_MODULE,
        .driver_name            = "serial",
-       .devfs_name             = "tts/",
        .dev_name               = "ttyS",
        .major                  = TTY_MAJOR,
 };
@@ -431,31 +426,32 @@ static int __init hv_console_compatible(char *buf, int len)
 
 static unsigned int __init get_interrupt(void)
 {
-       const char *cons_str = "console";
-       const char *compat_str = "compatible";
-       int node = prom_getchild(sun4v_vdev_root);
-       char buf[64];
-       int err, len;
-
-       node = prom_searchsiblings(node, cons_str);
-       if (!node)
-               return 0;
+       struct device_node *dev_node;
 
-       len = prom_getproplen(node, compat_str);
-       if (len == 0 || len == -1)
-               return 0;
+       dev_node = sun4v_vdev_root->child;
+       while (dev_node != NULL) {
+               struct property *prop;
 
-       err = prom_getproperty(node, compat_str, buf, 64);
-       if (err == -1)
-               return 0;
+               if (strcmp(dev_node->name, "console"))
+                       goto next_sibling;
+
+               prop = of_find_property(dev_node, "compatible", NULL);
+               if (!prop)
+                       goto next_sibling;
 
-       if (!hv_console_compatible(buf, len))
+               if (hv_console_compatible(prop->value, prop->length))
+                       break;
+
+       next_sibling:
+               dev_node = dev_node->sibling;
+       }
+       if (!dev_node)
                return 0;
 
        /* Ok, the this is the OBP node for the sun4v hypervisor
         * console device.  Decode the interrupt.
         */
-       return sun4v_vdev_device_interrupt(node);
+       return sun4v_vdev_device_interrupt(dev_node);
 }
 
 static int __init sunhv_init(void)
@@ -498,6 +494,7 @@ static int __init sunhv_init(void)
                return ret;
        }
 
+       sunhv_reg.tty_driver->name_base = sunhv_reg.minor - 64;
        sunserial_current_minor += 1;
 
        sunhv_reg.cons = SUNHV_CONSOLE();