diff options
Diffstat (limited to 'drivers/video/fbdev/arcfb.c')
-rw-r--r-- | drivers/video/fbdev/arcfb.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c index 08d15e408413..9aaea3be8281 100644 --- a/drivers/video/fbdev/arcfb.c +++ b/drivers/video/fbdev/arcfb.c @@ -41,6 +41,7 @@ #include <linux/vmalloc.h> #include <linux/delay.h> #include <linux/interrupt.h> +#include <linux/io.h> #include <linux/fb.h> #include <linux/init.h> #include <linux/arcfb.h> @@ -260,7 +261,7 @@ 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 = (unsigned char __force *) par->info->screen_base + (left/8) + + src = (unsigned char *)par->info->screen_buffer + (left/8) + (upper * linesize); ks108_set_xaddr(par, chipindex, left); @@ -451,6 +452,9 @@ static ssize_t arcfb_write(struct fb_info *info, const char __user *buf, struct arcfb_par *par; unsigned int xres; + if (!info->screen_buffer) + return -ENODEV; + p = *ppos; par = info->par; xres = info->var.xres; @@ -468,7 +472,7 @@ static ssize_t arcfb_write(struct fb_info *info, const char __user *buf, if (count) { char *base_addr; - base_addr = (char __force *)info->screen_base; + base_addr = info->screen_buffer; count -= copy_from_user(base_addr + p, buf, count); *ppos += count; err = -EFAULT; @@ -525,7 +529,7 @@ static int arcfb_probe(struct platform_device *dev) if (!info) goto err_fb_alloc; - info->screen_base = (char __iomem *)videomemory; + info->screen_buffer = videomemory; info->fbops = &arcfb_ops; info->var = arcfb_var; @@ -598,7 +602,7 @@ static void arcfb_remove(struct platform_device *dev) unregister_framebuffer(info); if (irq) free_irq(((struct arcfb_par *)(info->par))->irq, info); - vfree((void __force *)info->screen_base); + vfree(info->screen_buffer); framebuffer_release(info); } } |