aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSamu Onkalo <samu.p.onkalo@nokia.com>2010-05-24 17:33:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:07:03 -0400
commitfa1f68db6ca7ebb6fc4487ac215bffba06c01c28 (patch)
tree6682b0c8d27c0d0a377125215f54378be37c5b61 /drivers
parent6c5e303afdf2910e58aeda56c10506342545a5af (diff)
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 <samu.p.onkalo@nokia.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/misc.c1
1 files changed, 1 insertions, 0 deletions
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)
144 old_fops = file->f_op; 144 old_fops = file->f_op;
145 file->f_op = new_fops; 145 file->f_op = new_fops;
146 if (file->f_op->open) { 146 if (file->f_op->open) {
147 file->private_data = c;
147 err=file->f_op->open(inode,file); 148 err=file->f_op->open(inode,file);
148 if (err) { 149 if (err) {
149 fops_put(file->f_op); 150 fops_put(file->f_op);