Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[pandora-kernel.git] / drivers / auxdisplay / cfag12864b.c
index 683509f..4975859 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
+#include <linux/slab.h>
 #include <linux/cdev.h>
 #include <linux/delay.h>
 #include <linux/device.h>
@@ -336,16 +337,9 @@ static int __init cfag12864b_init(void)
                        "ks0108 is not initialized\n");
                goto none;
        }
+       BUILD_BUG_ON(PAGE_SIZE < CFAG12864B_SIZE);
 
-       if (PAGE_SIZE < CFAG12864B_SIZE) {
-               printk(KERN_ERR CFAG12864B_NAME ": ERROR: "
-                       "page size (%i) < cfag12864b size (%i)\n",
-                       (unsigned int)PAGE_SIZE, CFAG12864B_SIZE);
-               ret = -ENOMEM;
-               goto none;
-       }
-
-       cfag12864b_buffer = (unsigned char *) __get_free_page(GFP_KERNEL);
+       cfag12864b_buffer = (unsigned char *) get_zeroed_page(GFP_KERNEL);
        if (cfag12864b_buffer == NULL) {
                printk(KERN_ERR CFAG12864B_NAME ": ERROR: "
                        "can't get a free page\n");
@@ -367,8 +361,6 @@ static int __init cfag12864b_init(void)
        if (cfag12864b_workqueue == NULL)
                goto cachealloced;
 
-       memset(cfag12864b_buffer, 0, CFAG12864B_SIZE);
-
        cfag12864b_clear();
        cfag12864b_on();