aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc
diff options
context:
space:
mode:
authorStephan Lachowsky <stephan.lachowsky@maxim-ic.com>2011-05-31 18:24:21 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:56:04 -0400
commitc0c5e71e46638e5264c193db8636132e036a4c56 (patch)
treeeabbcc6ff7ebc7ec6c409269ae2ca67f6d53bb52 /drivers/media/video/uvc
parentfa14001480fb264b916ed6406ead24205dc1a86c (diff)
[media] uvcvideo: Fix control mapping for devices with multiple chains
The search for matching extension units fails to take account of the current chain. In the case where you have two distinct video chains, both containing an XU with the same GUID but different unit ids, you will be unable to perform a mapping on the second chain because entity on the first chain will always be found first Fix this by only searching the current chain when performing a control mapping. This is analogous to the search used by uvc_find_control(), and is the correct behaviour. Signed-off-by: Stephan Lachowsky <stephan.lachowsky@maxim-ic.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r--drivers/media/video/uvc/uvc_ctrl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
index a4db26fa2f5..53e82753cbc 100644
--- a/drivers/media/video/uvc/uvc_ctrl.c
+++ b/drivers/media/video/uvc/uvc_ctrl.c
@@ -1664,8 +1664,8 @@ int uvc_ctrl_add_mapping(struct uvc_video_chain *chain,
1664 return -EINVAL; 1664 return -EINVAL;
1665 } 1665 }
1666 1666
1667 /* Search for the matching (GUID/CS) control in the given device */ 1667 /* Search for the matching (GUID/CS) control on the current chain */
1668 list_for_each_entry(entity, &dev->entities, list) { 1668 list_for_each_entry(entity, &chain->entities, chain) {
1669 unsigned int i; 1669 unsigned int i;
1670 1670
1671 if (UVC_ENTITY_TYPE(entity) != UVC_VC_EXTENSION_UNIT || 1671 if (UVC_ENTITY_TYPE(entity) != UVC_VC_EXTENSION_UNIT ||