Merge branch 'for-2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
[safe/jmp/linux-2.6] / drivers / video / hpfb.c
index abd920a..c8e280f 100644 (file)
@@ -7,12 +7,9 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/tty.h>
-#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/fb.h>
@@ -209,7 +206,8 @@ static struct fb_ops hpfb_ops = {
 #define HPFB_FBOMSB    0x5d    /* Frame buffer offset          */
 #define HPFB_FBOLSB    0x5f
 
-static int __init hpfb_init_one(unsigned long phys_base, unsigned long virt_base)
+static int __devinit hpfb_init_one(unsigned long phys_base,
+                                  unsigned long virt_base)
 {
        unsigned long fboff, fb_width, fb_height, fb_start;
 
@@ -296,6 +294,8 @@ static int __init hpfb_init_one(unsigned long phys_base, unsigned long virt_base
 
        if (register_framebuffer(&fb_info) < 0) {
                fb_dealloc_cmap(&fb_info.cmap);
+               iounmap(fb_info.screen_base);
+               fb_info.screen_base = NULL;
                return 1;
        }
 
@@ -381,7 +381,7 @@ int __init hpfb_init(void)
 #define INTFBPADDR 0x560000
 
        if (!MACH_IS_HP300)
-               return -ENXIO;
+               return -ENODEV;
 
        if (fb_get_options("hpfb", NULL))
                return -ENODEV;