aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorMartin Kepplinger <martink@posteo.de>2015-03-23 08:59:46 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-25 06:36:38 -0400
commit03190c67ff72b5c56b24266762ab8abe68970f45 (patch)
treeef65dc83f28caa0cf100c47165b1ce4837d0ab53 /drivers/char
parentab3ae0096a6d31e1b244c5c5155f48ef3700329e (diff)
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@posteo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/misc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index ffa97d261cf3..c892c296a4de 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -169,7 +169,9 @@ static const struct file_operations misc_fops = {
169 * the minor number requested is used. 169 * the minor number requested is used.
170 * 170 *
171 * The structure passed is linked into the kernel and may not be 171 * The structure passed is linked into the kernel and may not be
172 * destroyed until it has been unregistered. 172 * destroyed until it has been unregistered. By default, an open()
173 * syscall to the device sets file->private_data to point to the
174 * structure. Drivers don't need open in fops for this.
173 * 175 *
174 * A zero is returned on success and a negative errno code for 176 * A zero is returned on success and a negative errno code for
175 * failure. 177 * failure.