[PATCH] char: documentation: more useful information about misc device

From: Martin Kepplinger
Date: Thu Oct 09 2014 - 12:39:59 EST

This might prevent code duplication in the future.

Signed-off-by: Martin Kepplinger <martink@xxxxxxxxx>
This is a suggestion for a place to put this information. I think this
makes sense but there might be a more appropriate place elsewhere.

drivers/char/misc.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index ffa97d2..6a3d15b 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -171,6 +171,10 @@ static const struct file_operations misc_fops = {
* The structure passed is linked into the kernel and may not be
* destroyed until it has been unregistered.
+ * If struct miscdevice's fops contain an implementation of open()
+ * the struct file's private data will be a pointer back to
+ * struct miscdevice.
+ *
* A zero is returned on success and a negative errno code for
* failure.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/