瀏覽代碼

char: misc: document behaviour of open()

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>
Martin Kepplinger 10 年之前
父節點
當前提交
965ab29ba0
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/char/misc.c

+ 3 - 1
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.