Merge branch 'semaphore' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc
[pandora-kernel.git] / drivers / video / acornfb.c
index 76448d6..017233d 100644 (file)
  *  - Blanking 8bpp displays with VIDC
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
 #include <linux/slab.h>
+#include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/fb.h>
 #include <linux/platform_device.h>
@@ -139,17 +139,6 @@ static struct pixclock arc_clocks[] = {
        {  41250,  42083, VIDC_CTRL_DIV1,   VID_CTL_24MHz },    /* 24.000MHz */
 };
 
-#ifdef CONFIG_ARCH_A5K
-static struct pixclock a5k_clocks[] = {
-       { 117974, 120357, VIDC_CTRL_DIV3,   VID_CTL_25MHz },    /*  8.392MHz */
-       {  78649,  80238, VIDC_CTRL_DIV2,   VID_CTL_25MHz },    /* 12.588MHz */
-       {  58987,  60178, VIDC_CTRL_DIV1_5, VID_CTL_25MHz },    /* 16.588MHz */
-       {  55000,  56111, VIDC_CTRL_DIV2,   VID_CTL_36MHz },    /* 18.000MHz */
-       {  39325,  40119, VIDC_CTRL_DIV1,   VID_CTL_25MHz },    /* 25.175MHz */
-       {  27500,  28055, VIDC_CTRL_DIV1,   VID_CTL_36MHz },    /* 36.000MHz */
-};
-#endif
-
 static struct pixclock *
 acornfb_valid_pixrate(struct fb_var_screeninfo *var)
 {
@@ -164,15 +153,6 @@ acornfb_valid_pixrate(struct fb_var_screeninfo *var)
                    pixclock < arc_clocks[i].max_clock)
                        return arc_clocks + i;
 
-#ifdef CONFIG_ARCH_A5K
-       if (machine_is_a5k()) {
-               for (i = 0; i < ARRAY_SIZE(a5k_clocks); i++)
-                       if (pixclock > a5k_clocks[i].min_clock &&
-                           pixclock < a5k_clocks[i].max_clock)
-                               return a5k_clocks + i;
-       }
-#endif
-
        return NULL;
 }
 
@@ -1308,7 +1288,7 @@ static int __init acornfb_probe(struct platform_device *dev)
        /*
         * Try to select a suitable default mode
         */
-       for (i = 0; i < sizeof(modedb) / sizeof(*modedb); i++) {
+       for (i = 0; i < ARRAY_SIZE(modedb); i++) {
                unsigned long hs;
 
                hs = modedb[i].refresh *
@@ -1380,7 +1360,7 @@ static int __init acornfb_probe(struct platform_device *dev)
         */
        free_unused_pages(PAGE_OFFSET + size, PAGE_OFFSET + MAX_SIZE);
 #endif
-       
+
        fb_info.fix.smem_len = size;
        current_par.palette_size   = VIDC_PALETTE_SIZE;
 
@@ -1391,7 +1371,7 @@ static int __init acornfb_probe(struct platform_device *dev)
         */
        do {
                rc = fb_find_mode(&fb_info.var, &fb_info, NULL, modedb,
-                                sizeof(modedb) / sizeof(*modedb),
+                                ARRAY_SIZE(modedb),
                                 &acornfb_default_mode, DEFAULT_BPP);
                /*
                 * If we found an exact match, all ok.
@@ -1408,7 +1388,7 @@ static int __init acornfb_probe(struct platform_device *dev)
                        break;
 
                rc = fb_find_mode(&fb_info.var, &fb_info, NULL, modedb,
-                                sizeof(modedb) / sizeof(*modedb),
+                                ARRAY_SIZE(modedb),
                                 &acornfb_default_mode, DEFAULT_BPP);
                if (rc)
                        break;