mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: changbin.du@intel.com
To: balbi@ti.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: [PATCH] usb: gadget: make usb_ep_enable return -EBUSY if ep has already enabled
Date: Fri,  4 Dec 2015 15:24:50 +0800	[thread overview]
Message-ID: <1449213890-27390-1-git-send-email-changbin.du@intel.com> (raw)

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;
 
 	ret = ep->ops->enable(ep, ep->desc);
 	if (ret)
-- 
2.5.0


             reply	other threads:[~2015-12-04  7:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04  7:24 changbin.du [this message]
2015-12-10 17:24 ` Felipe Balbi
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=1449213890-27390-1-git-send-email-changbin.du@intel.com \
    --to=changbin.du@intel.com \
    --cc=John.Youn@synopsys.com \
    --cc=balbi@ti.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