From: Martin Kepplinger Date: Mon, 23 Mar 2015 12:59:46 +0000 (+0100) Subject: char: misc: document behaviour of open() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=03190c67ff72b5c56b24266762ab8abe68970f45;p=linux-beck.git 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 Signed-off-by: Greg Kroah-Hartman --- 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 = { * 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. Drivers don't need open in fops for this. * * A zero is returned on success and a negative errno code for * failure.