Skip to content

Commit

Permalink
[media] uvcvideo: Fix control mapping for devices with multiple chains
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephan Lachowsky authored and Mauro Carvalho Chehab committed Jul 27, 2011
1 parent fa14001 commit c0c5e71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/video/uvc/uvc_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,8 +1664,8 @@ int uvc_ctrl_add_mapping(struct uvc_video_chain *chain,
return -EINVAL;
}

/* Search for the matching (GUID/CS) control in the given device */
list_for_each_entry(entity, &dev->entities, list) {
/* Search for the matching (GUID/CS) control on the current chain */
list_for_each_entry(entity, &chain->entities, chain) {
unsigned int i;

if (UVC_ENTITY_TYPE(entity) != UVC_VC_EXTENSION_UNIT ||
Expand Down

0 comments on commit c0c5e71

Please sign in to comment.