[POWERPC] macintosh: ADB driver: adb_handler_sem semaphore to mutex
[safe/jmp/linux-2.6] / drivers / macintosh / ans-lcd.c
index 2b8a6e8..73c50bc 100644 (file)
 #include <asm/uaccess.h>
 #include <asm/sections.h>
 #include <asm/prom.h>
-#include <asm/ans-lcd.h>
 #include <asm/io.h>
 
+#include "ans-lcd.h"
+
 #define ANSLCD_ADDR            0xf301c000
 #define ANSLCD_CTRL_IX 0x00
 #define ANSLCD_DATA_IX 0x10
@@ -121,7 +122,7 @@ anslcd_open( struct inode * inode, struct file * file )
        return 0;
 }
 
-struct file_operations anslcd_fops = {
+const struct file_operations anslcd_fops = {
        .write  = anslcd_write,
        .ioctl  = anslcd_ioctl,
        .open   = anslcd_open,
@@ -145,11 +146,12 @@ anslcd_init(void)
        int retval;
        struct device_node* node;
 
-       node = find_devices("lcd");
-       if (!node || !node->parent)
-               return -ENODEV;
-       if (strcmp(node->parent->name, "gc"))
+       node = of_find_node_by_name(NULL, "lcd");
+       if (!node || !node->parent || strcmp(node->parent->name, "gc")) {
+               of_node_put(node);
                return -ENODEV;
+       }
+       of_node_put(node);
 
        anslcd_ptr = ioremap(ANSLCD_ADDR, 0x20);