[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427115589-469-2-git-send-email-martink@posteo.de>
Date: Mon, 23 Mar 2015 13:59:46 +0100
From: Martin Kepplinger <martink@...teo.de>
To: tomvanbraeckel@...il.com
Cc: linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
arnd@...db.de, Martin Kepplinger <martink@...teo.de>
Subject: [PATCH 1/4] char: misc: document behaviour of open()
an open syscall now assignes file->private_data to a pointer to the
miscdevice structure. This reminds people not to duplicate code if
they want this and not to depend on it being NULL.
Signed-off-by: Martin Kepplinger <martink@...teo.de>
---
drivers/char/misc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 32ab943..c05e2f4 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -168,7 +168,9 @@ static const struct file_operations misc_fops = {
* the minor number requested is used.
*
* The structure passed is linked into the kernel and may not be
- * destroyed until it has been unregistered.
+ * destroyed until it has been unregistered. By default, an open()
+ * syscall to the device sets file->private_data to point to the
+ * structure. Drivers don't need open in fops for this.
*
* A zero is returned on success and a negative errno code for
* failure.
--
2.1.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