kref: Fix typo in kref documentation
Javi Merino [Mon, 7 Mar 2011 21:13:07 +0000 (21:13 +0000)]
container_of() should refer to the struct created in the example.

Signed-off-by: Javi Merino <cibervicho@gmail.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Documentation/kref.txt

index ae203f9..48ba715 100644 (file)
@@ -156,7 +156,7 @@ static struct my_data *get_entry()
        struct my_data *entry = NULL;
        mutex_lock(&mutex);
        if (!list_empty(&q)) {
-               entry = container_of(q.next, struct my_q_entry, link);
+               entry = container_of(q.next, struct my_data, link);
                kref_get(&entry->refcount);
        }
        mutex_unlock(&mutex);