From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Michael Walle <mwalle@kernel.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: f_acm: make bInterfaceProtocol configurable
Date: Wed, 31 Jul 2024 11:16:00 +0200 [thread overview]
Message-ID: <2024073145-treat-winnings-3bb4@gregkh> (raw)
In-Reply-To: <D33LLE6K8QGH.1BCZM42INRVEX@kernel.org>
On Wed, Jul 31, 2024 at 10:57:04AM +0200, Michael Walle wrote:
> Hi Greg,
>
> On Wed Jul 31, 2024 at 10:32 AM CEST, Greg Kroah-Hartman wrote:
> > On Tue, Jul 30, 2024 at 09:43:37PM +0200, Michael Walle wrote:
> > > struct f_serial_opts {
> > > struct usb_function_instance func_inst;
> > > u8 port_num;
> > > + u8 protocol;
> > > +
> > > + struct mutex lock;
> > > + int refcnt;
> >
> > Attempting to "roll your own" reference count is almost never a good
> > idea. If you really need one, please use the proper in-kernel apis for
> > this. But you need to justify it as well, I didn't see why this was
> > needed at all.
>
> Honestly, I couldn't grok all that usb gadget magic, so I've looked
> at similar gadgets and took that from there:
> grep refcnt drivers/usb/gadget/function/ -r
>
> They are all doing the same, so maybe that code is old or didn't use
> the proper APIs back then.
It's old code, please do things properly.
thanks,
greg k-h
next prev parent reply other threads:[~2024-07-31 9:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 19:43 Michael Walle
2024-07-31 8:32 ` Greg Kroah-Hartman
2024-07-31 8:57 ` Michael Walle
2024-07-31 9:16 ` Greg Kroah-Hartman [this message]
2024-07-31 20:11 ` Michael Walle
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=2024073145-treat-winnings-3bb4@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mwalle@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®