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, gregkh@linuxfoundation.org
Subject: [PATCH v3 4/5] Docs: usb: update explanation for device_present to disconnected
Date: Mon, 6 Dec 2021 21:58:08 +0100 [thread overview]
Message-ID: <d81cd79c560877e1d2dbf3267f23a8f436b04417.1638771720.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1638771720.git.philipp.g.hortmann@gmail.com>
Update text for `device_present` flag to `disconnected` flag
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
V1 -> V2: Corrected format of function name to skel_disconnect()
V2 -> V3: Moved correction of the function name to an own patch in this
patch series
---
.../driver-api/usb/writing_usb_driver.rst | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/Documentation/driver-api/usb/writing_usb_driver.rst b/Documentation/driver-api/usb/writing_usb_driver.rst
index 6c487ac5eab2..1968cf5c55f6 100644
--- a/Documentation/driver-api/usb/writing_usb_driver.rst
+++ b/Documentation/driver-api/usb/writing_usb_driver.rst
@@ -278,15 +278,13 @@ this::
}
-If a program currently has an open handle to the device, we reset the
-flag ``device_present``. For every read, write, release and other
+If the driver probed the device successfully, the flag ``disconnected``
+is initialized and set to false. For every read, write and other
functions that expect a device to be present, the driver first checks
-this flag to see if the device is still present. If not, it releases
-that the device has disappeared, and a ``-ENODEV`` error is returned to the
-user-space program. When the release function is eventually called, it
-determines if there is no device and if not, it does the cleanup that
-the ``skel_disconnect`` function normally does if there are no open files
-on the device (see Listing 5).
+this flag to see if the device is still present. If not, a ``-ENODEV``
+error is returned to the user-space program. When the device is
+disconnected, the ``skel_disconnect`` function is called. It sets
+``disconnected`` to true and cleans up.
Isochronous Data
================
--
2.25.1
next prev parent reply other threads:[~2021-12-06 20:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-06 20:57 [PATCH v3 0/5] Docs: usb: Code and text updates from usb-skeleton Philipp Hortmann
2021-12-06 20:57 ` [PATCH v3 1/5] Docs: usb: update usb_bulk_msg receiving example Philipp Hortmann
2021-12-07 8:55 ` Oliver Neukum
2021-12-13 5:06 ` Philipp Hortmann
2021-12-06 20:57 ` [PATCH v3 2/5] Docs: usb: update comment and code near decrement our usage count for the device Philipp Hortmann
2021-12-07 9:30 ` Oliver Neukum
2021-12-12 1:25 ` Philipp Hortmann
2021-12-06 20:58 ` [PATCH v3 3/5] Docs: usb: update comment and code of function skel_delete Philipp Hortmann
2021-12-06 20:58 ` Philipp Hortmann [this message]
2021-12-06 20:58 ` [PATCH v3 5/5] Docs: usb: correct format of function names in the explanations 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=d81cd79c560877e1d2dbf3267f23a8f436b04417.1638771720.git.philipp.g.hortmann@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=corbet@lwn.net \
--cc=gregkh@linuxfoundation.org \
--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®