]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/controlfb.c
local_t: parisc cleanup
[linux-2.6-omap-h63xx.git] / drivers / video / controlfb.c
index acdd6a103dbb49d97c881274c0314e691382f1e0..8b762739b1e02720ff36bc2010165760a4c252ed 100644 (file)
@@ -36,7 +36,6 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
@@ -180,12 +179,14 @@ MODULE_LICENSE("GPL");
 int init_module(void)
 {
        struct device_node *dp;
+       int ret = -ENXIO;
 
-       dp = find_devices("control");
+       dp = of_find_node_by_name(NULL, "control");
        if (dp != 0 && !control_of_init(dp))
-               return 0;
+               ret = 0;
+       of_node_put(dp);
 
-       return -ENXIO;
+       return ret;
 }
 
 void cleanup_module(void)
@@ -416,13 +417,15 @@ static int __init init_control(struct fb_info_control *p)
        full = p->total_vram == 0x400000;
 
        /* Try to pick a video mode out of NVRAM if we have one. */
+#ifdef CONFIG_NVRAM
        if (default_cmode == CMODE_NVRAM){
                cmode = nvram_read_byte(NV_CMODE);
                if(cmode < CMODE_8 || cmode > CMODE_32)
                        cmode = CMODE_8;
        } else
+#endif
                cmode=default_cmode;
-
+#ifdef CONFIG_NVRAM
        if (default_vmode == VMODE_NVRAM) {
                vmode = nvram_read_byte(NV_VMODE);
                if (vmode < 1 || vmode > VMODE_MAX ||
@@ -433,7 +436,9 @@ static int __init init_control(struct fb_info_control *p)
                        if (control_mac_modes[vmode - 1].m[full] < cmode)
                                vmode = VMODE_640_480_60;
                }
-       } else {
+       } else
+#endif
+       {
                vmode=default_vmode;
                if (control_mac_modes[vmode - 1].m[full] < cmode) {
                        if (cmode > CMODE_8)
@@ -586,16 +591,18 @@ static int __init control_init(void)
 {
        struct device_node *dp;
        char *option = NULL;
+       int ret = -ENXIO;
 
        if (fb_get_options("controlfb", &option))
                return -ENODEV;
        control_setup(option);
 
-       dp = find_devices("control");
+       dp = of_find_node_by_name(NULL, "control");
        if (dp != 0 && !control_of_init(dp))
-               return 0;
+               ret = 0;
+       of_node_put(dp);
 
-       return -ENXIO;
+       return ret;
 }
 
 module_init(control_init);
@@ -693,11 +700,10 @@ static int __init control_of_init(struct device_node *dp)
                printk(KERN_ERR "can't get 2 addresses for control\n");
                return -ENXIO;
        }
-       p = kmalloc(sizeof(*p), GFP_KERNEL);
+       p = kzalloc(sizeof(*p), GFP_KERNEL);
        if (p == 0)
                return -ENXIO;
        control_fb = p; /* save it for cleanups */
-       memset(p, 0, sizeof(*p));
 
        /* Map in frame buffer and registers */
        p->fb_orig_base = fb_res.start;