提交 c0c5e71e 编写于 作者: S Stephan Lachowsky 提交者: Mauro Carvalho Chehab

[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: NStephan Lachowsky <stephan.lachowsky@maxim-ic.com>
Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 fa140014
...@@ -1664,8 +1664,8 @@ int uvc_ctrl_add_mapping(struct uvc_video_chain *chain, ...@@ -1664,8 +1664,8 @@ int uvc_ctrl_add_mapping(struct uvc_video_chain *chain,
return -EINVAL; return -EINVAL;
} }
/* Search for the matching (GUID/CS) control in the given device */ /* Search for the matching (GUID/CS) control on the current chain */
list_for_each_entry(entity, &dev->entities, list) { list_for_each_entry(entity, &chain->entities, chain) {
unsigned int i; unsigned int i;
if (UVC_ENTITY_TYPE(entity) != UVC_VC_EXTENSION_UNIT || if (UVC_ENTITY_TYPE(entity) != UVC_VC_EXTENSION_UNIT ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册