All of lore.kernel.org
 help / color / mirror / Atom feed
From: Salah Triki <salah.triki@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] misc: powermate: update the reference count of the usb interface structure
Date: Sun, 25 Jul 2021 00:56:37 +0100	[thread overview]
Message-ID: <20210724235637.GA590874@pc> (raw)
In-Reply-To: <YPydUp9vc5U7vGIw@google.com>

Hi,

On Sat, Jul 24, 2021 at 04:08:02PM -0700, Dmitry Torokhov wrote:
> 
> On Sat, Jul 24, 2021 at 10:20:16PM +0100, Salah Triki wrote:
> > Use usb_get_intf() and usb_put_intf() in order to update the reference
> > count of the usb interface structure.
> 
> This is quite pointless as the driver will be unbound from the interface
> before interface is deleted.

From the documentation of usb_get_intf():

[quote]

Each live reference to a interface must be refcounted.

Drivers for USB interfaces should normally record such references in their 
probe() methods, when they bind to an interface, and release them by calling
usb_put_intf(), in their disconnect() methods.

[/quote]

Thanx

  reply	other threads:[~2021-07-24 23:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-24 21:20 [PATCH] misc: powermate: update the reference count of the usb interface structure Salah Triki
2021-07-24 23:08 ` Dmitry Torokhov
2021-07-24 23:56   ` Salah Triki [this message]
2021-07-25  4:35     ` Dmitry Torokhov

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=20210724235637.GA590874@pc \
    --to=salah.triki@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.