]> err.no Git - linux-2.6/blobdiff - drivers/serial/uartlite.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6] / drivers / serial / uartlite.c
index b22023f1ec6bc1a47a1b80b02eb16ff641c3122d..b51c24245be4e361d05c0bf545760375806d0a3a 100644 (file)
@@ -153,7 +153,7 @@ static int ulite_transmit(struct uart_port *port, int stat)
 
 static irqreturn_t ulite_isr(int irq, void *dev_id)
 {
-       struct uart_port *port = (struct uart_port *)dev_id;
+       struct uart_port *port = dev_id;
        int busy;
 
        do {
@@ -389,32 +389,6 @@ static void ulite_console_write(struct console *co, const char *s,
                spin_unlock_irqrestore(&port->lock, flags);
 }
 
-#if defined(CONFIG_OF)
-static inline void __init ulite_console_of_find_device(int id)
-{
-       struct device_node *np;
-       struct resource res;
-       const unsigned int *of_id;
-       int rc;
-
-       for_each_matching_node(np, ulite_of_match) {
-               of_id = of_get_property(np, "port-number", NULL);
-               if ((!of_id) || (*of_id != id))
-                       continue;
-
-               rc = of_address_to_resource(np, 0, &res);
-               if (rc)
-                       continue;
-
-               ulite_ports[id].mapbase = res.start;
-               of_node_put(np);
-               return;
-       }
-}
-#else /* CONFIG_OF */
-static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ }
-#endif /* CONFIG_OF */
-
 static int __init ulite_console_setup(struct console *co, char *options)
 {
        struct uart_port *port;
@@ -428,11 +402,7 @@ static int __init ulite_console_setup(struct console *co, char *options)
 
        port = &ulite_ports[co->index];
 
-       /* Check if it is an OF device */
-       if (!port->mapbase)
-               ulite_console_of_find_device(co->index);
-
-       /* Do we have a device now? */
+       /* Has the device been initialized yet? */
        if (!port->mapbase) {
                pr_debug("console on ttyUL%i not present\n", co->index);
                return -ENODEV;
@@ -591,6 +561,9 @@ static int __devexit ulite_remove(struct platform_device *pdev)
        return ulite_release(&pdev->dev);
 }
 
+/* work with hotplug and coldplug */
+MODULE_ALIAS("platform:uartlite");
+
 static struct platform_driver ulite_platform_driver = {
        .probe  = ulite_probe,
        .remove = __devexit_p(ulite_remove),
@@ -611,7 +584,7 @@ ulite_of_probe(struct of_device *op, const struct of_device_id *match)
        const unsigned int *id;
        int irq, rc;
 
-       dev_dbg(&op->dev, "%s(%p, %p)\n", __FUNCTION__, op, match);
+       dev_dbg(&op->dev, "%s(%p, %p)\n", __func__, op, match);
 
        rc = of_address_to_resource(op->node, 0, &res);
        if (rc) {