diff mbox

[08/28] usb: gadget: function: uvc: return correct alt-setting

Message ID 1413565804-13061-9-git-send-email-balbi@ti.com
State Accepted
Commit e975be287b87e0862b0f57e7326a79667e32a90a
Headers show

Commit Message

Felipe Balbi Oct. 17, 2014, 5:09 p.m. UTC
If our alternate setting has been selected, we must
return that on a subsequent Get Interface request
even if we're not streaming.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/gadget/function/f_uvc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index e00e8b7..4138ad5 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -279,7 +279,7 @@  uvc_function_get_alt(struct usb_function *f, unsigned interface)
 	else if (interface != uvc->streaming_intf)
 		return -EINVAL;
 	else
-		return uvc->state == UVC_STATE_STREAMING ? 1 : 0;
+		return uvc->video.ep->driver_data ? 1 : 0;
 }
 
 static int