aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/arcfb.c14
-rw-r--r--drivers/video/epson1355fb.c18
-rw-r--r--drivers/video/fbmem.c4
-rw-r--r--drivers/video/hecubafb.c12
-rw-r--r--drivers/video/pvr2fb.c4
5 files changed, 9 insertions, 43 deletions
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 740b83b4bd8c..c668e56c9272 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -440,14 +440,11 @@ static int arcfb_ioctl(struct fb_info *info,
440 * the fb. it's inefficient for them to do anything less than 64*8 440 * the fb. it's inefficient for them to do anything less than 64*8
441 * writes since we update the lcd in each write() anyway. 441 * writes since we update the lcd in each write() anyway.
442 */ 442 */
443static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t count, 443static ssize_t arcfb_write(struct fb_info *info, const char __user *buf,
444 loff_t *ppos) 444 size_t count, loff_t *ppos)
445{ 445{
446 /* modded from epson 1355 */ 446 /* modded from epson 1355 */
447 447
448 struct inode *inode;
449 int fbidx;
450 struct fb_info *info;
451 unsigned long p; 448 unsigned long p;
452 int err=-EINVAL; 449 int err=-EINVAL;
453 unsigned int fbmemlength,x,y,w,h, bitppos, startpos, endpos, bitcount; 450 unsigned int fbmemlength,x,y,w,h, bitppos, startpos, endpos, bitcount;
@@ -455,13 +452,6 @@ static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t cou
455 unsigned int xres; 452 unsigned int xres;
456 453
457 p = *ppos; 454 p = *ppos;
458 inode = file->f_path.dentry->d_inode;
459 fbidx = iminor(inode);
460 info = registered_fb[fbidx];
461
462 if (!info || !info->screen_base)
463 return -ENODEV;
464
465 par = info->par; 455 par = info->par;
466 xres = info->var.xres; 456 xres = info->var.xres;
467 fbmemlength = (xres * info->var.yres)/8; 457 fbmemlength = (xres * info->var.yres)/8;
diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c
index 37e297d7feb7..ca2c54ce508e 100644
--- a/drivers/video/epson1355fb.c
+++ b/drivers/video/epson1355fb.c
@@ -403,17 +403,10 @@ static inline unsigned long copy_to_user16(void *to, const void *from,
403 403
404 404
405static ssize_t 405static ssize_t
406epson1355fb_read(struct file *file, char *buf, size_t count, loff_t * ppos) 406epson1355fb_read(struct fb_info *info, char *buf, size_t count, loff_t * ppos)
407{ 407{
408 struct inode *inode = file->f_path.dentry->d_inode;
409 int fbidx = iminor(inode);
410 struct fb_info *info = registered_fb[fbidx];
411 unsigned long p = *ppos; 408 unsigned long p = *ppos;
412 409
413 /* from fbmem.c except for our own copy_*_user */
414 if (!info || !info->screen_base)
415 return -ENODEV;
416
417 if (p >= info->fix.smem_len) 410 if (p >= info->fix.smem_len)
418 return 0; 411 return 0;
419 if (count >= info->fix.smem_len) 412 if (count >= info->fix.smem_len)
@@ -434,20 +427,13 @@ epson1355fb_read(struct file *file, char *buf, size_t count, loff_t * ppos)
434} 427}
435 428
436static ssize_t 429static ssize_t
437epson1355fb_write(struct file *file, const char *buf, 430epson1355fb_write(struct fb_info *info, const char *buf,
438 size_t count, loff_t * ppos) 431 size_t count, loff_t * ppos)
439{ 432{
440 struct inode *inode = file->f_path.dentry->d_inode;
441 int fbidx = iminor(inode);
442 struct fb_info *info = registered_fb[fbidx];
443 unsigned long p = *ppos; 433 unsigned long p = *ppos;
444 int err; 434 int err;
445 435
446 /* from fbmem.c except for our own copy_*_user */ 436 /* from fbmem.c except for our own copy_*_user */
447 if (!info || !info->screen_base)
448 return -ENODEV;
449
450 /* from fbmem.c except for our own copy_*_user */
451 if (p > info->fix.smem_len) 437 if (p > info->fix.smem_len)
452 return -ENOSPC; 438 return -ENOSPC;
453 if (count >= info->fix.smem_len) 439 if (count >= info->fix.smem_len)
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 08c292d9c401..7b72841222df 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -588,7 +588,7 @@ fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
588 return -EPERM; 588 return -EPERM;
589 589
590 if (info->fbops->fb_read) 590 if (info->fbops->fb_read)
591 return info->fbops->fb_read(file, buf, count, ppos); 591 return info->fbops->fb_read(info, buf, count, ppos);
592 592
593 total_size = info->screen_size; 593 total_size = info->screen_size;
594 594
@@ -663,7 +663,7 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
663 return -EPERM; 663 return -EPERM;
664 664
665 if (info->fbops->fb_write) 665 if (info->fbops->fb_write)
666 return info->fbops->fb_write(file, buf, count, ppos); 666 return info->fbops->fb_write(info, buf, count, ppos);
667 667
668 total_size = info->screen_size; 668 total_size = info->screen_size;
669 669
diff --git a/drivers/video/hecubafb.c b/drivers/video/hecubafb.c
index 0ade72590998..3ec0e97f36e4 100644
--- a/drivers/video/hecubafb.c
+++ b/drivers/video/hecubafb.c
@@ -267,12 +267,9 @@ static void hecubafb_imageblit(struct fb_info *info,
267 * this is the slow path from userspace. they can seek and write to 267 * this is the slow path from userspace. they can seek and write to
268 * the fb. it's inefficient to do anything less than a full screen draw 268 * the fb. it's inefficient to do anything less than a full screen draw
269 */ 269 */
270static ssize_t hecubafb_write(struct file *file, const char __user *buf, 270static ssize_t hecubafb_write(struct fb_info *info, const char __user *buf,
271 size_t count, loff_t *ppos) 271 size_t count, loff_t *ppos)
272{ 272{
273 struct inode *inode;
274 int fbidx;
275 struct fb_info *info;
276 unsigned long p; 273 unsigned long p;
277 int err=-EINVAL; 274 int err=-EINVAL;
278 struct hecubafb_par *par; 275 struct hecubafb_par *par;
@@ -280,13 +277,6 @@ static ssize_t hecubafb_write(struct file *file, const char __user *buf,
280 unsigned int fbmemlength; 277 unsigned int fbmemlength;
281 278
282 p = *ppos; 279 p = *ppos;
283 inode = file->f_dentry->d_inode;
284 fbidx = iminor(inode);
285 info = registered_fb[fbidx];
286
287 if (!info || !info->screen_base)
288 return -ENODEV;
289
290 par = info->par; 280 par = info->par;
291 xres = info->var.xres; 281 xres = info->var.xres;
292 fbmemlength = (xres * info->var.yres)/8; 282 fbmemlength = (xres * info->var.yres)/8;
diff --git a/drivers/video/pvr2fb.c b/drivers/video/pvr2fb.c
index a93618bc9d27..df2909ae704c 100644
--- a/drivers/video/pvr2fb.c
+++ b/drivers/video/pvr2fb.c
@@ -214,7 +214,7 @@ static int pvr2_init_cable(void);
214static int pvr2_get_param(const struct pvr2_params *p, const char *s, 214static int pvr2_get_param(const struct pvr2_params *p, const char *s,
215 int val, int size); 215 int val, int size);
216#ifdef CONFIG_SH_DMA 216#ifdef CONFIG_SH_DMA
217static ssize_t pvr2fb_write(struct file *file, const char *buf, 217static ssize_t pvr2fb_write(struct fb_info *info, const char *buf,
218 size_t count, loff_t *ppos); 218 size_t count, loff_t *ppos);
219#endif 219#endif
220 220
@@ -674,7 +674,7 @@ static int pvr2_init_cable(void)
674} 674}
675 675
676#ifdef CONFIG_SH_DMA 676#ifdef CONFIG_SH_DMA
677static ssize_t pvr2fb_write(struct file *file, const char *buf, 677static ssize_t pvr2fb_write(struct fb_info *info, const char *buf,
678 size_t count, loff_t *ppos) 678 size_t count, loff_t *ppos)
679{ 679{
680 unsigned long dst, start, end, len; 680 unsigned long dst, start, end, len;