From: Laurent Pinchart Date: Thu, 21 Jun 2012 09:35:04 +0000 (-0300) Subject: [media] uvcvideo: Fix alternate setting selection X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4807063faa08f279b4ca9c2b1f0101a4670f7d43;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] uvcvideo: Fix alternate setting selection The alternate setting number is not equal to the alternate setting index in the interface alternate settings table. Use the alternate setting number from the interface descriptor when calling usb_set_interface(). Signed-off-by: Laurent Pinchart Signed-off-by: Ming Lei Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index 39f5c85dd4b4..7ac4347ca09e 100644 --- a/drivers/media/video/uvc/uvc_video.c +++ b/drivers/media/video/uvc/uvc_video.c @@ -1598,7 +1598,7 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags) psize = le16_to_cpu(ep->desc.wMaxPacketSize); psize = (psize & 0x07ff) * (1 + ((psize >> 11) & 3)); if (psize >= bandwidth && psize <= best_psize) { - altsetting = i; + altsetting = alts->desc.bAlternateSetting; best_psize = psize; best_ep = ep; }