diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-06-17 10:11:51 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 14:33:55 -0400 |
commit | 1b4e21c4f62eae6bdcb3e7bfdfc52171a24f3689 (patch) | |
tree | c06dabaeb7c4bcbcc1b734dda461c738e27d73d8 /drivers/media/video/uvc | |
parent | 561474c2d2a1e212ea186e0b65cc69fb330e7bd5 (diff) |
V4L/DVB: uvcvideo: Define control information bits using macros
Use the macros instead of hardcoding numerical constants for the
controls information bitfield.
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')
-rw-r--r-- | drivers/media/video/uvc/uvc_ctrl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index bd72100a21dd..fa06cf512ecf 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c | |||
@@ -1324,9 +1324,8 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev, | |||
1324 | /* Check if the device control information and length match | 1324 | /* Check if the device control information and length match |
1325 | * the user supplied information. | 1325 | * the user supplied information. |
1326 | */ | 1326 | */ |
1327 | __u32 flags; | ||
1328 | __le16 size; | 1327 | __le16 size; |
1329 | __u8 inf; | 1328 | __u8 _info; |
1330 | 1329 | ||
1331 | ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id, | 1330 | ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id, |
1332 | dev->intfnum, info->selector, (__u8 *)&size, 2); | 1331 | dev->intfnum, info->selector, (__u8 *)&size, 2); |
@@ -1345,7 +1344,7 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev, | |||
1345 | } | 1344 | } |
1346 | 1345 | ||
1347 | ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id, | 1346 | ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id, |
1348 | dev->intfnum, info->selector, &inf, 1); | 1347 | dev->intfnum, info->selector, &_info, 1); |
1349 | if (ret < 0) { | 1348 | if (ret < 0) { |
1350 | uvc_trace(UVC_TRACE_CONTROL, | 1349 | uvc_trace(UVC_TRACE_CONTROL, |
1351 | "GET_INFO failed on control %pUl/%u (%d).\n", | 1350 | "GET_INFO failed on control %pUl/%u (%d).\n", |
@@ -1353,9 +1352,10 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev, | |||
1353 | return; | 1352 | return; |
1354 | } | 1353 | } |
1355 | 1354 | ||
1356 | flags = info->flags; | 1355 | if (((info->flags & UVC_CONTROL_GET_CUR) && |
1357 | if (((flags & UVC_CONTROL_GET_CUR) && !(inf & (1 << 0))) || | 1356 | !(_info & UVC_CONTROL_CAP_GET)) || |
1358 | ((flags & UVC_CONTROL_SET_CUR) && !(inf & (1 << 1)))) { | 1357 | ((info->flags & UVC_CONTROL_SET_CUR) && |
1358 | !(_info & UVC_CONTROL_CAP_SET))) { | ||
1359 | uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u flags " | 1359 | uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u flags " |
1360 | "don't match supported operations.\n", | 1360 | "don't match supported operations.\n", |
1361 | info->entity, info->selector); | 1361 | info->entity, info->selector); |