]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/char_dev.c
Merge branch 'acpi-config'
[karo-tx-linux.git] / fs / char_dev.c
index b9bc05b9513a285e94e097423aa1c044cbe59392..f77f7702fabe1e2ab0a21f6ef0b9dd36247a9f50 100644 (file)
@@ -368,6 +368,7 @@ void cdev_put(struct cdev *p)
  */
 static int chrdev_open(struct inode *inode, struct file *filp)
 {
+       const struct file_operations *fops;
        struct cdev *p;
        struct cdev *new = NULL;
        int ret = 0;
@@ -400,10 +401,11 @@ static int chrdev_open(struct inode *inode, struct file *filp)
                return ret;
 
        ret = -ENXIO;
-       filp->f_op = fops_get(p->ops);
-       if (!filp->f_op)
+       fops = fops_get(p->ops);
+       if (!fops)
                goto out_cdev_put;
 
+       replace_fops(filp, fops);
        if (filp->f_op->open) {
                ret = filp->f_op->open(inode, filp);
                if (ret)