X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmacintosh%2Fans-lcd.c;h=73c50bc02095e26b31ec61d76ee81f7f46e4e36d;hb=7ca796f492a11f9408e661c8f22cd8c4f486b8e5;hp=2b8a6e821d44b51a52a87854165a5a251484ee81;hpb=7079060f3e86ea4c1d4e9c1e356592ef9dcaaa1f;p=linux-2.6 diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c index 2b8a6e821d..73c50bc020 100644 --- a/drivers/macintosh/ans-lcd.c +++ b/drivers/macintosh/ans-lcd.c @@ -14,9 +14,10 @@ #include #include #include -#include #include +#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);