V4L/DVB (13946): proc_fops: convert av7110
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 22 Dec 2009 00:21:47 +0000 (21:21 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 26 Feb 2010 18:10:33 +0000 (15:10 -0300)
Drop S_IRUGO, proc entry doesn't contain read hooks.
Drop S_IFREG, simply unnecessary.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/ttpci/av7110_ir.c

index 23a1c63..b070e88 100644 (file)
@@ -268,8 +268,8 @@ int av7110_check_ir_config(struct av7110 *av7110, int force)
 
 
 /* /proc/av7110_ir interface */
-static int av7110_ir_write_proc(struct file *file, const char __user *buffer,
-                               unsigned long count, void *data)
+static ssize_t av7110_ir_proc_write(struct file *file, const char __user *buffer,
+                                   size_t count, loff_t *pos)
 {
        char *page;
        u32 ir_config;
@@ -309,6 +309,10 @@ static int av7110_ir_write_proc(struct file *file, const char __user *buffer,
        return count;
 }
 
+static const struct file_operations av7110_ir_proc_fops = {
+       .owner          = THIS_MODULE,
+       .write          = av7110_ir_proc_write,
+};
 
 /* interrupt handler */
 static void ir_handler(struct av7110 *av7110, u32 ircom)
@@ -368,11 +372,9 @@ int __devinit av7110_ir_init(struct av7110 *av7110)
        input_dev->timer.data = (unsigned long) &av7110->ir;
 
        if (av_cnt == 1) {
-               e = create_proc_entry("av7110_ir", S_IFREG | S_IRUGO | S_IWUSR, NULL);
-               if (e) {
-                       e->write_proc = av7110_ir_write_proc;
+               e = proc_create("av7110_ir", S_IWUSR, NULL, &av7110_ir_proc_fops);
+               if (e)
                        e->size = 4 + 256 * sizeof(u16);
-               }
        }
 
        tasklet_init(&av7110->ir.ir_tasklet, av7110_emit_key, (unsigned long) &av7110->ir);