diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2009-11-25 10:00:22 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:42:12 -0500 |
commit | 6241d8ca1dc27356180011dff4d93a3c5b3cbd76 (patch) | |
tree | d406a9dd8f8cdad7054d5de42f3262a248e2c5d3 /drivers/media/video/uvc/uvc_ctrl.c | |
parent | bce039c099e97b07534518b5f3c0ce31b1606ff6 (diff) |
V4L/DVB (13503): uvcvideo: Merge iterms, oterms and units linked lists
All terminals and units are now added to a single linked list of
entities per chain. This makes terminals and units handling code more
generic.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_ctrl.c')
-rw-r--r-- | drivers/media/video/uvc/uvc_ctrl.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index 6f1487fc3d7c..0469d7a876a8 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c | |||
@@ -742,17 +742,7 @@ struct uvc_control *uvc_find_control(struct uvc_video_chain *chain, | |||
742 | v4l2_id &= V4L2_CTRL_ID_MASK; | 742 | v4l2_id &= V4L2_CTRL_ID_MASK; |
743 | 743 | ||
744 | /* Find the control. */ | 744 | /* Find the control. */ |
745 | __uvc_find_control(chain->processing, v4l2_id, mapping, &ctrl, next); | 745 | list_for_each_entry(entity, &chain->entities, chain) { |
746 | if (ctrl && !next) | ||
747 | return ctrl; | ||
748 | |||
749 | list_for_each_entry(entity, &chain->iterms, chain) { | ||
750 | __uvc_find_control(entity, v4l2_id, mapping, &ctrl, next); | ||
751 | if (ctrl && !next) | ||
752 | return ctrl; | ||
753 | } | ||
754 | |||
755 | list_for_each_entry(entity, &chain->extensions, chain) { | ||
756 | __uvc_find_control(entity, v4l2_id, mapping, &ctrl, next); | 746 | __uvc_find_control(entity, v4l2_id, mapping, &ctrl, next); |
757 | if (ctrl && !next) | 747 | if (ctrl && !next) |
758 | return ctrl; | 748 | return ctrl; |
@@ -951,17 +941,7 @@ int __uvc_ctrl_commit(struct uvc_video_chain *chain, int rollback) | |||
951 | int ret = 0; | 941 | int ret = 0; |
952 | 942 | ||
953 | /* Find the control. */ | 943 | /* Find the control. */ |
954 | ret = uvc_ctrl_commit_entity(chain->dev, chain->processing, rollback); | 944 | list_for_each_entry(entity, &chain->entities, chain) { |
955 | if (ret < 0) | ||
956 | goto done; | ||
957 | |||
958 | list_for_each_entry(entity, &chain->iterms, chain) { | ||
959 | ret = uvc_ctrl_commit_entity(chain->dev, entity, rollback); | ||
960 | if (ret < 0) | ||
961 | goto done; | ||
962 | } | ||
963 | |||
964 | list_for_each_entry(entity, &chain->extensions, chain) { | ||
965 | ret = uvc_ctrl_commit_entity(chain->dev, entity, rollback); | 945 | ret = uvc_ctrl_commit_entity(chain->dev, entity, rollback); |
966 | if (ret < 0) | 946 | if (ret < 0) |
967 | goto done; | 947 | goto done; |
@@ -1075,8 +1055,9 @@ int uvc_xu_ctrl_query(struct uvc_video_chain *chain, | |||
1075 | int ret; | 1055 | int ret; |
1076 | 1056 | ||
1077 | /* Find the extension unit. */ | 1057 | /* Find the extension unit. */ |
1078 | list_for_each_entry(entity, &chain->extensions, chain) { | 1058 | list_for_each_entry(entity, &chain->entities, chain) { |
1079 | if (entity->id == xctrl->unit) | 1059 | if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT && |
1060 | entity->id == xctrl->unit) | ||
1080 | break; | 1061 | break; |
1081 | } | 1062 | } |
1082 | 1063 | ||