]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
fbdev: pass struct fb_info to fb_read and fb_write
authorAntonino A. Daplas <adaplas@gmail.com>
Tue, 8 May 2007 07:39:02 +0000 (00:39 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 8 May 2007 18:15:30 +0000 (11:15 -0700)
It is unnecessary to pass struct file to fb_read() and fb_write() in struct
fb_ops. For consistency with the other methods, pass struct fb_info instead.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/arcfb.c
drivers/video/epson1355fb.c
drivers/video/fbmem.c
drivers/video/hecubafb.c
drivers/video/pvr2fb.c
include/linux/fb.h

index 740b83b4bd8c1658604a362a6dbbcfd6c1111a34..c668e56c927253296b218544e8bc01d5c0ac4c5f 100644 (file)
@@ -440,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;
@@ -455,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;
index 37e297d7feb7fa4e7b537cbe2e9468952129ca77..ca2c54ce508e678ee8deaafa63016c9bae783948 100644 (file)
@@ -403,17 +403,10 @@ static inline unsigned long copy_to_user16(void *to, const void *from,
 
 
 static ssize_t
-epson1355fb_read(struct file *file, char *buf, size_t count, loff_t * ppos)
+epson1355fb_read(struct fb_info *info, char *buf, size_t count, loff_t * ppos)
 {
-       struct inode *inode = file->f_path.dentry->d_inode;
-       int fbidx = iminor(inode);
-       struct fb_info *info = registered_fb[fbidx];
        unsigned long p = *ppos;
 
-       /* from fbmem.c except for our own copy_*_user */
-       if (!info || !info->screen_base)
-               return -ENODEV;
-
        if (p >= info->fix.smem_len)
                return 0;
        if (count >= info->fix.smem_len)
@@ -434,19 +427,12 @@ epson1355fb_read(struct file *file, char *buf, size_t count, loff_t * ppos)
 }
 
 static ssize_t
-epson1355fb_write(struct file *file, const char *buf,
+epson1355fb_write(struct fb_info *info, const char *buf,
                  size_t count, loff_t * ppos)
 {
-       struct inode *inode = file->f_path.dentry->d_inode;
-       int fbidx = iminor(inode);
-       struct fb_info *info = registered_fb[fbidx];
        unsigned long p = *ppos;
        int err;
 
-       /* from fbmem.c except for our own copy_*_user */
-       if (!info || !info->screen_base)
-               return -ENODEV;
-
        /* from fbmem.c except for our own copy_*_user */
        if (p > info->fix.smem_len)
                return -ENOSPC;
index 08c292d9c40119e8b3970b2370b060d20b8d1d25..7b72841222df9bea722ff2608ba81659c235518b 100644 (file)
@@ -588,7 +588,7 @@ fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
                return -EPERM;
 
        if (info->fbops->fb_read)
-               return info->fbops->fb_read(file, buf, count, ppos);
+               return info->fbops->fb_read(info, buf, count, ppos);
        
        total_size = info->screen_size;
 
@@ -663,7 +663,7 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
                return -EPERM;
 
        if (info->fbops->fb_write)
-               return info->fbops->fb_write(file, buf, count, ppos);
+               return info->fbops->fb_write(info, buf, count, ppos);
        
        total_size = info->screen_size;
 
index 0ade7259099818f5ad218778ea7ebc3aecaf13af..3ec0e97f36e45522bb8027908d7cc9b8a2f28304 100644 (file)
@@ -267,12 +267,9 @@ static void hecubafb_imageblit(struct fb_info *info,
  * this is the slow path from userspace. they can seek and write to
  * the fb. it's inefficient to do anything less than a full screen draw
  */
-static ssize_t hecubafb_write(struct file *file, const char __user *buf,
+static ssize_t hecubafb_write(struct fb_info *info, const char __user *buf,
                                size_t count, loff_t *ppos)
 {
-       struct inode *inode;
-       int fbidx;
-       struct fb_info *info;
        unsigned long p;
        int err=-EINVAL;
        struct hecubafb_par *par;
@@ -280,13 +277,6 @@ static ssize_t hecubafb_write(struct file *file, const char __user *buf,
        unsigned int fbmemlength;
 
        p = *ppos;
-       inode = file->f_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;
index a93618bc9d274527fd627f4decdabb96347ff05f..df2909ae704cd51132021b14a85d066f71b5517b 100644 (file)
@@ -214,7 +214,7 @@ static int pvr2_init_cable(void);
 static int pvr2_get_param(const struct pvr2_params *p, const char *s,
                             int val, int size);
 #ifdef CONFIG_SH_DMA
-static ssize_t pvr2fb_write(struct file *file, const char *buf,
+static ssize_t pvr2fb_write(struct fb_info *info, const char *buf,
                            size_t count, loff_t *ppos);
 #endif
 
@@ -674,7 +674,7 @@ static int pvr2_init_cable(void)
 }
 
 #ifdef CONFIG_SH_DMA
-static ssize_t pvr2fb_write(struct file *file, const char *buf,
+static ssize_t pvr2fb_write(struct fb_info *info, const char *buf,
                            size_t count, loff_t *ppos)
 {
        unsigned long dst, start, end, len;
index c4e1b3d2ecf9d57b38a75e489a97a80e90731102..acb6ddb68fa26ae474462f43233a1881e3eb0a0c 100644 (file)
@@ -591,8 +591,10 @@ struct fb_ops {
        /* For framebuffers with strange non linear layouts or that do not
         * work with normal memory mapped access
         */
-       ssize_t (*fb_read)(struct file *file, char __user *buf, size_t count, loff_t *ppos);
-       ssize_t (*fb_write)(struct file *file, const char __user *buf, size_t count, loff_t *ppos);
+       ssize_t (*fb_read)(struct fb_info *info, char __user *buf,
+                          size_t count, loff_t *ppos);
+       ssize_t (*fb_write)(struct fb_info *info, const char __user *buf,
+                           size_t count, loff_t *ppos);
 
        /* checks var and eventually tweaks it to something supported,
         * DO NOT MODIFY PAR */