[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1272864693-27343-2-git-send-email-samu.p.onkalo@nokia.com>
Date: Mon, 3 May 2010 08:31:33 +0300
From: Samu Onkalo <samu.p.onkalo@...ia.com>
To: linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org
Subject: [PATCH 1/1] 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@...ia.com>
---
drivers/char/misc.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 92ab03d..cd650ca 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);
--
1.6.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists