pata_hpt3x2n: fix clock turnaround
[safe/jmp/linux-2.6] / drivers / serial / apbuart.c
index 5f9dec3..fe91319 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/device.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/serial_core.h>
@@ -608,7 +609,7 @@ static void grlib_apbuart_configure(void)
                return;
 
        /* Get bus frequency */
-       rp = of_find_node_by_name(NULL, "/");
+       rp = of_find_node_by_path("/");
        rp = of_get_next_child(rp, NULL);
        prop = of_get_property(rp, "clock-frequency", NULL);
        freq_khz = *prop;
@@ -676,8 +677,7 @@ static int __init grlib_apbuart_init(void)
                return ret;
        }
 
-       ret = of_register_driver(&grlib_apbuart_of_driver, &of_platform_bus_type);
-
+       ret = of_register_platform_driver(&grlib_apbuart_of_driver);
        if (ret) {
                printk(KERN_ERR
                       "%s: of_register_platform_driver failed (%i)\n",
@@ -698,7 +698,7 @@ static void __exit grlib_apbuart_exit(void)
                                     &grlib_apbuart_ports[i]);
 
        uart_unregister_driver(&grlib_apbuart_driver);
-
+       of_unregister_platform_driver(&grlib_apbuart_of_driver);
 }
 
 module_init(grlib_apbuart_init);