From: Felipe Balbi <balbi@kernel.org>
To: Baolin Wang <baolin.wang@linaro.org>,
Greg KH <gregkh@linuxfoundation.org>
Cc: Badhri Jagan Sridharan <Badhri@google.com>,
Mark Brown <broonie@kernel.org>, USB <linux-usb@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] usb: gadget: Add uevent to notify userspace
Date: Thu, 22 Sep 2016 15:53:14 +0300 [thread overview]
Message-ID: <878tuk6qpx.fsf@linux.intel.com> (raw)
In-Reply-To: <CAMz4kuK=tOeNpn_5iXAjg-bc+7EK9AwfC0-eCPXO1H=tFNurbQ@mail.gmail.com>
Hi,
Baolin Wang <baolin.wang@linaro.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?
--
balbi
next prev parent reply other threads:[~2016-09-22 12:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-22 11:43 [PATCH v2] usb: gadget: Add uevent to notify userspace Baolin Wang
2016-09-22 12:23 ` Greg KH
2016-09-22 12:41 ` Baolin Wang
2016-09-22 12:53 ` Felipe Balbi [this message]
2016-09-23 2:17 ` Baolin Wang
2016-09-22 13:38 ` Greg KH
2016-09-22 16:36 ` Mark Brown
2016-09-22 20:50 ` Badhri Jagan Sridharan
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=878tuk6qpx.fsf@linux.intel.com \
--to=balbi@kernel.org \
--cc=Badhri@google.com \
--cc=baolin.wang@linaro.org \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.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).