[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMz4kuLmQAzu39M7+0zbNjyDjCcMksapFAPLxUjYbZPvYWBALA@mail.gmail.com>
Date: Fri, 23 Sep 2016 10:17:08 +0800
From: Baolin Wang <baolin.wang@...aro.org>
To: Felipe Balbi <balbi@...nel.org>
Cc: Greg KH <gregkh@...uxfoundation.org>,
Badhri Jagan Sridharan <Badhri@...gle.com>,
Mark Brown <broonie@...nel.org>,
USB <linux-usb@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] usb: gadget: Add uevent to notify userspace
Hi,
On 22 September 2016 at 20:53, Felipe Balbi <balbi@...nel.org> wrote:
>
>
> Hi,
>
> Baolin Wang <baolin.wang@...aro.org> writes:
>>>> static const struct usb_gadget_driver configfs_driver_template = {
>>>> .bind = configfs_composite_bind,
>>>> .unbind = configfs_composite_unbind,
>>>>
>>>> +#ifdef CONFIG_USB_CONFIGFS_UEVENT
>>>> + .setup = configfs_setup,
>>>> + .reset = configfs_disconnect,
>>>> + .disconnect = configfs_disconnect,
>>>> +#else
>>>> .setup = composite_setup,
>>>> .reset = composite_disconnect,
>>>> .disconnect = composite_disconnect,
>>>> +#endif
>
> nope, this is quite wrong.
>
>>>> @@ -1453,6 +1556,10 @@ static struct config_group *gadgets_make(
>>>> gi->composite.gadget_driver.function = kstrdup(name, GFP_KERNEL);
>>>> gi->composite.name = gi->composite.gadget_driver.function;
>>>>
>>>> +#ifdef CONFIG_USB_CONFIGFS_UEVENT
>>>> + INIT_WORK(&gi->work, configfs_work);
>>>> +#endif
>>>
>>> This is just way too ugly, please make it so there are no #ifdefs in the
>>> .c files.
>>>
>>> Or, as others said, why is this a build option at all, why would you not
>>> always want this enabled if you are relying on it all of the time?
>>
>> Sometimes userspace does not need the notification, it is not all the
>> time. Anyway I will remove the macro if you still insist on that.
>
> what's wrong with the sysfs we already have for this?
If Android system userspace can support udc-core's uevents like Badhri
said, I am fine with that.
--
Baolin.wang
Best Regards
Powered by blists - more mailing lists