Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1621878
| Path | csiph.com!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Felipe Balbi <balbi@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 1/3] usb: udc: allow adding and removing the same gadget device |
| Date | Wed, 12 Apr 2017 09:40:01 +0200 |
| Message-ID | <tvl2F-1FX-3@gated-at.bofh.it> (permalink) |
| References | <tuYz8-3XH-27@gated-at.bofh.it> <tv4Oe-85I-25@gated-at.bofh.it> <tv4Of-85I-37@gated-at.bofh.it> <tvjDz-Xu-1@gated-at.bofh.it> <tvkgi-1az-19@gated-at.bofh.it> |
| X-Extloop1 | 1 |
| X-Ironport-Av | E=Sophos;i="5.37,189,1488873600"; d="asc'?scan'208";a="1118494780" |
| MIME-Version | 1.0 |
| Content-Type | multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 65 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Alan Stern <stern@rowland.harvard.edu>, Roger Quadros <rogerq@ti.com>, vivek.gautam@codeaurora.org, USB list <linux-usb@vger.kernel.org>, Kernel development list <linux-kernel@vger.kernel.org> |
| X-Original-Date | Wed, 12 Apr 2017 10:33:34 +0300 |
| X-Original-Message-ID | <87fuheaxm9.fsf@linux.intel.com> |
| X-Original-References | <87r30zcs95.fsf@linux.intel.com> <Pine.LNX.4.44L0.1704110955370.1707-100000@iolanthe.rowland.org> <20170411141927.GB27233@kroah.com> <87wpaqb1vb.fsf@linux.intel.com> <20170412064550.GA6143@kroah.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1621878 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
Hi,
Greg KH <greg@kroah.com> writes:
>> Here's what we have for most UDCs (net2280.c included):
>>
>> struct my_udc {
>> struct gadget gadget;
>> [...]
>> };
>>
>> probe()
>> {
>> struct my_udc *u;
>>
>> u = kzalloc(sizeof(*u), GFP_KERNEL);
>> [...]
>> return 0;
>> }
>>
>> Now, if this kzalloc() would be replaced with devm_kzalloc() wouldn't
>> this result on a functionally equivalent execution to the patch I
>> proposed above?
>>
>> Iff we change struct gadget to contain a struct device *dev instead of a
>> struct device dev, then sure, we will need to cope with proper
>> ->release() implementations.
>>
>> As it is, it brings nothing to the table, IMO.
>
> You always have to have a release function for a kobject, no matter
> where it is, as it is being reference counted. To not do so, is a huge
> indication of a problem in the design.
okay, this goes all the way back to when Dave B wrote the API, it has
always had empty ->release() functions (not all UDCs, though). I'll make
sure to review all of this for v4.13.
--
balbi
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v3 1/3] usb: udc: allow adding and removing the same gadget device Alan Stern <stern@rowland.harvard.edu> - 2017-04-10 17:20 +0200
Re: [PATCH v3 1/3] usb: udc: allow adding and removing the same gadget device Felipe Balbi <balbi@kernel.org> - 2017-04-11 09:40 +0200
Re: [PATCH v3 1/3] usb: udc: allow adding and removing the same gadget device Alan Stern <stern@rowland.harvard.edu> - 2017-04-11 16:20 +0200
Re: [PATCH v3 1/3] usb: udc: allow adding and removing the same gadget device Greg KH <greg@kroah.com> - 2017-04-11 16:20 +0200
Re: [PATCH v3 1/3] usb: udc: allow adding and removing the same gadget device Felipe Balbi <balbi@kernel.org> - 2017-04-12 08:10 +0200
Re: [PATCH v3 1/3] usb: udc: allow adding and removing the same gadget device Greg KH <greg@kroah.com> - 2017-04-12 08:50 +0200
Re: [PATCH v3 1/3] usb: udc: allow adding and removing the same gadget device Felipe Balbi <balbi@kernel.org> - 2017-04-12 09:40 +0200
Re: [PATCH v3 1/3] usb: udc: allow adding and removing the same gadget device Alan Stern <stern@rowland.harvard.edu> - 2017-04-12 16:40 +0200
csiph-web