intel-iommu: Fix boot inside 64bit virtualbox with io-apic disabled
[safe/jmp/linux-2.6] / drivers / video / sgivwfb.c
index c0cc5e3..7a3a5e2 100644 (file)
@@ -9,7 +9,6 @@
  *  more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -22,8 +21,7 @@
 
 #include <asm/io.h>
 #include <asm/mtrr.h>
-
-#include <setup_arch.h>
+#include <asm/visws/sgivw.h>
 
 #define INCLUDE_TIMING_TABLE_DATA
 #define DBE_REG_BASE par->regs
@@ -262,13 +260,13 @@ static int sgivwfb_check_var(struct fb_var_screeninfo *var,
        var->grayscale = 0;     /* No grayscale for now */
 
        /* determine valid resolution and timing */
-       for (min_mode = 0; min_mode < DBE_VT_SIZE; min_mode++) {
+       for (min_mode = 0; min_mode < ARRAY_SIZE(dbeVTimings); min_mode++) {
                if (dbeVTimings[min_mode].width >= var->xres &&
                    dbeVTimings[min_mode].height >= var->yres)
                        break;
        }
 
-       if (min_mode == DBE_VT_SIZE)
+       if (min_mode == ARRAY_SIZE(dbeVTimings))
                return -EINVAL; /* Resolution to high */
 
        /* XXX FIXME - should try to pick best refresh rate */
@@ -747,13 +745,13 @@ int __init sgivwfb_setup(char *options)
 /*
  *  Initialisation
  */
-static int __init sgivwfb_probe(struct platform_device *dev)
+static int __devinit sgivwfb_probe(struct platform_device *dev)
 {
        struct sgivw_par *par;
        struct fb_info *info;
        char *monitor;
 
-       info = framebuffer_alloc(sizeof(struct sgivw_par) + sizeof(u32) * 256, &dev->dev);
+       info = framebuffer_alloc(sizeof(struct sgivw_par) + sizeof(u32) * 16, &dev->dev);
        if (!info)
                return -ENOMEM;
        par = info->par;
@@ -839,6 +837,8 @@ static int sgivwfb_remove(struct platform_device *dev)
                iounmap(par->regs);
                iounmap(info->screen_base);
                release_mem_region(DBE_REG_PHYS, DBE_REG_SIZE);
+               fb_dealloc_cmap(&info->cmap);
+               framebuffer_release(info);
        }
        return 0;
 }