From: Felipe Balbi <balbi@ti.com>
To: <changbin.du@intel.com>
Cc: <gregkh@linuxfoundation.org>, <John.Youn@synopsys.com>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
"Du, Changbin" <changbin.du@intel.com>
Subject: Re: [PATCH] usb: gadget: make usb_ep_enable return -EBUSY if ep has already enabled
Date: Thu, 10 Dec 2015 11:24:16 -0600 [thread overview]
Message-ID: <8737vajjy7.fsf@saruman.tx.rr.com> (raw)
In-Reply-To: <1449213890-27390-1-git-send-email-changbin.du@intel.com>
[-- Attachment #1: Type: text/plain, Size: 939 bytes --]
Hi,
changbin.du@intel.com writes:
> From: "Du, Changbin" <changbin.du@intel.com>
>
> When usb_ep_enable on a enabled ep, the configuration of the ep probably
> has changed. In this scenario, the ep configuration in hw should be
> reprogrammed by udc driver. Hence, it is better to return an error to
> inform the caller.
>
> Signed-off-by: Du, Changbin <changbin.du@intel.com>
> ---
> include/linux/usb/gadget.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index d813bd2..89f9fdd 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -268,7 +268,7 @@ static inline int usb_ep_enable(struct usb_ep *ep)
> int ret;
>
> if (ep->enabled)
> - return 0;
> + return -EBUSY;
While at that, can you add a WARN_ON() as well ?
if (WARN_ON(ep->enabled))
return -EBUSY;
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2015-12-10 17:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-04 7:24 changbin.du
2015-12-10 17:24 ` Felipe Balbi [this message]
2015-12-14 3:16 ` Du, Changbin
2015-12-14 3:40 ` [PATCH v2] " changbin.du
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=8737vajjy7.fsf@saruman.tx.rr.com \
--to=balbi@ti.com \
--cc=John.Youn@synopsys.com \
--cc=changbin.du@intel.com \
--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
Powered by JetHome