char: misc: document behaviour of open()
authorMartin Kepplinger <martink@posteo.de>
Wed, 29 Oct 2014 19:22:58 +0000 (20:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 18:25:52 +0000 (10:25 -0800)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/misc.c

index 205ad4c584708257578d519e895b6be3a52bbe89..69a08a6b43aae2c16499bb6de2cafb8f1790c6d9 100644 (file)
@@ -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.