提交 03190c67 编写于 作者: M Martin Kepplinger 提交者: Greg Kroah-Hartman

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: NMartin Kepplinger <martink@posteo.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ab3ae009
...@@ -169,7 +169,9 @@ static const struct file_operations misc_fops = { ...@@ -169,7 +169,9 @@ static const struct file_operations misc_fops = {
* the minor number requested is used. * the minor number requested is used.
* *
* The structure passed is linked into the kernel and may not be * 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 * A zero is returned on success and a negative errno code for
* failure. * failure.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册