[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170626073505.2792-2-julian@jusst.de>
Date: Mon, 26 Jun 2017 09:35:03 +0200
From: Julian Scheel <julian@...st.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jonathan Corbet <corbet@....net>,
Felipe Balbi <balbi@...nel.org>,
Julian Scheel <julian@...st.de>,
Ruslan Bilovol <ruslan.bilovol@...il.com>,
Peter Chen <peter.chen@....com>, Sekhar Nori <nsekhar@...com>,
Thierry Reding <thierry.reding@...il.com>,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
linux-doc@...r.kernel.org
Subject: [PATCH 1/3] usb: gadget: f_uac1: Fix endpoint reading
The endpoint is stored in the lower byte of wIndex, according to USB
Audio 1.0 specification, section 5.2.1.1.
Signed-off-by: Julian Scheel <julian@...st.de>
---
drivers/usb/gadget/function/f_uac1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index 8656f84e17d9..b955913bd7ea 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -327,7 +327,7 @@ static int audio_set_endpoint_req(struct usb_function *f,
{
struct usb_composite_dev *cdev = f->config->cdev;
int value = -EOPNOTSUPP;
- u16 ep = le16_to_cpu(ctrl->wIndex);
+ u8 ep = le16_to_cpu(ctrl->wIndex) & 0xff;
u16 len = le16_to_cpu(ctrl->wLength);
u16 w_value = le16_to_cpu(ctrl->wValue);
@@ -363,7 +363,7 @@ static int audio_get_endpoint_req(struct usb_function *f,
{
struct usb_composite_dev *cdev = f->config->cdev;
int value = -EOPNOTSUPP;
- u8 ep = ((le16_to_cpu(ctrl->wIndex) >> 8) & 0xFF);
+ u8 ep = le16_to_cpu(ctrl->wIndex) & 0xff;
u16 len = le16_to_cpu(ctrl->wLength);
u16 w_value = le16_to_cpu(ctrl->wValue);
--
2.13.1
Powered by blists - more mailing lists