From: Samu Onkalo Date: Mon, 24 May 2010 21:33:10 +0000 (-0700) Subject: drivers: misc: pass miscdevice pointer via file private data X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fa1f68db6ca;p=linux-beck.git drivers: misc: pass miscdevice pointer via file private data For misc devices, inode->i_cdev doesn't point to the device drivers own data. Link between file operations and device driver internal data is lost. Pass pointer to misc device struct via file private data for driver open function use. Signed-off-by: Samu Onkalo Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 92ab03d28294..cd650ca8c679 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -144,6 +144,7 @@ static int misc_open(struct inode * inode, struct file * file) old_fops = file->f_op; file->f_op = new_fops; if (file->f_op->open) { + file->private_data = c; err=file->f_op->open(inode,file); if (err) { fops_put(file->f_op);