From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Subject: [PATCH 2/4] Docs: usb: update comment and code near decrement our usage count for the device
Date: Mon, 29 Nov 2021 21:21:47 +0100 [thread overview]
Message-ID: <75317b591c0da0d32be77b819680733a44f6f70b.1638152984.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1638152984.git.philipp.g.hortmann@gmail.com>
Put release function in the document typical form
Update comment: decrement our usage count ..
and code according to usb-skeleton.c
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
Documentation/driver-api/usb/writing_usb_driver.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/driver-api/usb/writing_usb_driver.rst b/Documentation/driver-api/usb/writing_usb_driver.rst
index a9608ad18d77..b16e4e76d472 100644
--- a/Documentation/driver-api/usb/writing_usb_driver.rst
+++ b/Documentation/driver-api/usb/writing_usb_driver.rst
@@ -250,12 +250,12 @@ a device, it is recommended to set up your own urbs and submit them to
the USB subsystem. The template uses urbs for read and write.
When the user program releases the file handle that it has been using to
-talk to the device, the release function in the driver is called. In
+talk to the device, the `skel_release` function in the driver is called. In
this function we decrement our private usage count and wait for possible
pending writes::
- /* decrement our usage count for the device */
- --skel->open_count;
+ /* decrement the count on our device */
+ kref_put(&dev->kref, skel_delete);
One of the more difficult problems that USB drivers must be able to
--
2.25.1
next prev parent reply other threads:[~2021-11-29 22:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-29 20:21 [PATCH 0/4] Docs: usb: Code and text updates from usb-skeleton Philipp Hortmann
2021-11-29 20:21 ` [PATCH 1/4] Docs: usb: update usb_bulk_msg receiving example Philipp Hortmann
2021-11-30 20:10 ` Alan Stern
2021-12-02 4:49 ` Philipp Hortmann
2021-12-02 19:49 ` Alan Stern
2021-12-03 2:01 ` Akira Yokosawa
2021-11-29 20:21 ` Philipp Hortmann [this message]
2021-11-29 20:21 ` [PATCH 3/4] Docs: usb: update comment and code of function skel_delete Philipp Hortmann
2021-12-03 10:57 ` Greg KH
2021-11-29 20:21 ` [PATCH 4/4] Docs: usb: update explanation for device_present to disconnected Philipp Hortmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=75317b591c0da0d32be77b819680733a44f6f70b.1638152984.git.philipp.g.hortmann@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®