linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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/3] Docs: usb: update comment and code near increment usage count
Date: Fri, 29 Oct 2021 21:39:58 +0200	[thread overview]
Message-ID: <53328d28190d987dc0ac5b455014bfe32cf39a64.1635533924.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1635533924.git.philipp.g.hortmann@gmail.com>

update comment: increment 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 | 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 5c29e5bdbe88..14eda0342649 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


  parent reply	other threads:[~2021-10-29 19:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 19:39 [PATCH 0/3] Docs: usb: Example code updates from usb-skeleton Philipp Hortmann
2021-10-29 19:39 ` [PATCH 1/3] Docs: usb: update err() to pr_err() and replace __FILE__ Philipp Hortmann
2021-10-29 20:33   ` Sergey Shtylyov
2021-10-30  9:32     ` Sergey Shtylyov
2021-10-29 19:39 ` Philipp Hortmann [this message]
2021-10-29 19:40 ` [PATCH 3/3] Docs: usb: update writesize, copy_from_user, usb_fill_bulk_urb, usb_submit_urb 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=53328d28190d987dc0ac5b455014bfe32cf39a64.1635533924.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;
as well as URLs for NNTP newsgroup(s).