mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
consolidate the reassignments of ->f_op in ->open() instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user