Merge branch 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak...
[pandora-kernel.git] / drivers / video / arcfb.c
index 30a8369..c343169 100644 (file)
@@ -48,7 +48,7 @@
 #include <linux/arcfb.h>
 #include <linux/platform_device.h>
 
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 
 #define floor8(a) (a&(~0x07))
 #define floorXres(a,xres) (a&(~(xres - 1)))
@@ -262,7 +262,8 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper,
        ks108_set_yaddr(par, chipindex, upper/8);
 
        linesize = par->info->var.xres/8;
-       src = par->info->screen_base + (left/8) + (upper * linesize);
+       src = (unsigned char __force *) par->info->screen_base + (left/8) +
+               (upper * linesize);
        ks108_set_xaddr(par, chipindex, left);
 
        bitmask=1;
@@ -368,7 +369,7 @@ static void arcfb_fillrect(struct fb_info *info,
 {
        struct arcfb_par *par = info->par;
 
-       cfb_fillrect(info, rect);
+       sys_fillrect(info, rect);
 
        /* update the physical lcd */
        arcfb_lcd_update(par, rect->dx, rect->dy, rect->width, rect->height);
@@ -379,7 +380,7 @@ static void arcfb_copyarea(struct fb_info *info,
 {
        struct arcfb_par *par = info->par;
 
-       cfb_copyarea(info, area);
+       sys_copyarea(info, area);
 
        /* update the physical lcd */
        arcfb_lcd_update(par, area->dx, area->dy, area->width, area->height);
@@ -389,7 +390,7 @@ static void arcfb_imageblit(struct fb_info *info, const struct fb_image *image)
 {
        struct arcfb_par *par = info->par;
 
-       cfb_imageblit(info, image);
+       sys_imageblit(info, image);
 
        /* update the physical lcd */
        arcfb_lcd_update(par, image->dx, image->dy, image->width,
@@ -439,14 +440,11 @@ static int arcfb_ioctl(struct fb_info *info,
  * the fb. it's inefficient for them to do anything less than 64*8
  * writes since we update the lcd in each write() anyway.
  */
-static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t count,
-                               loff_t *ppos)
+static ssize_t arcfb_write(struct fb_info *info, const char __user *buf,
+                          size_t count, loff_t *ppos)
 {
        /* modded from epson 1355 */
 
-       struct inode *inode;
-       int fbidx;
-       struct fb_info *info;
        unsigned long p;
        int err=-EINVAL;
        unsigned int fbmemlength,x,y,w,h, bitppos, startpos, endpos, bitcount;
@@ -454,13 +452,6 @@ static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t cou
        unsigned int xres;
 
        p = *ppos;
-       inode = file->f_path.dentry->d_inode;
-       fbidx = iminor(inode);
-       info = registered_fb[fbidx];
-
-       if (!info || !info->screen_base)
-               return -ENODEV;
-
        par = info->par;
        xres = info->var.xres;
        fbmemlength = (xres * info->var.yres)/8;
@@ -477,7 +468,7 @@ static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t cou
        if (count) {
                char *base_addr;
 
-               base_addr = info->screen_base;
+               base_addr = (char __force *)info->screen_base;
                count -= copy_from_user(base_addr + p, buf, count);
                *ppos += count;
                err = -EFAULT;
@@ -503,6 +494,7 @@ static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t cou
 static struct fb_ops arcfb_ops = {
        .owner          = THIS_MODULE,
        .fb_open        = arcfb_open,
+       .fb_read        = fb_sys_read,
        .fb_write       = arcfb_write,
        .fb_release     = arcfb_release,
        .fb_pan_display = arcfb_pan_display,
@@ -603,7 +595,7 @@ static int arcfb_remove(struct platform_device *dev)
 
        if (info) {
                unregister_framebuffer(info);
-               vfree(info->screen_base);
+               vfree((void __force *)info->screen_base);
                framebuffer_release(info);
        }
        return 0;