Thread (4 messages) 4 messages, 1 author, 2021-10-30
STALE1713d LANDED

[PATCH v2 2/3] Docs: usb: update comment and code near increment usage count

From: Philipp Hortmann <hidden>
Date: 2021-10-30 11:25:10
Also in: linux-doc, lkml
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

update comment: increment our usage count ..
and code according to usb-skeleton.c

Signed-off-by: Philipp Hortmann <redacted>
---
 Documentation/driver-api/usb/writing_usb_driver.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/driver-api/usb/writing_usb_driver.rst b/Documentation/driver-api/usb/writing_usb_driver.rst
index 85e106f443e5..24374cdb677b 100644
--- a/Documentation/driver-api/usb/writing_usb_driver.rst
+++ b/Documentation/driver-api/usb/writing_usb_driver.rst
@@ -167,8 +167,8 @@ structure. This is done so that future calls to file operations will
 enable the driver to determine which device the user is addressing. All
 of this is done with the following code::
 
-    /* increment our usage count for the module */
-    ++skel->open_count;
+    /* increment our usage count for the device */
+    kref_get(&dev->kref);
 
     /* save our object in the file's private structure */
     file->private_data = dev;
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help