lkml.org 
[lkml]   [2014]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] char: misc: document behaviour of open()
Date
an open syscall now assignes file->private_data to a pointer to the
miscdevice structure. This reminds driver developers not to duplicate
code if they need this.

Signed-off-by: Martin Kepplinger <martink@posteo.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 205ad4c..69a08a6 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -169,7 +169,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.
*
* A zero is returned on success and a negative errno code for
* failure.
--
1.7.10.4


\
 
 \ /
  Last update: 2014-10-29 21:01    [W:0.045 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site