diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-06-17 11:11:51 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 15:33:55 -0300 |
commit | 1b4e21c4f62eae6bdcb3e7bfdfc52171a24f3689 (patch) | |
tree | c06dabaeb7c4bcbcc1b734dda461c738e27d73d8 /drivers/media/video/uvc/uvc_ctrl.c | |
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/uvc_ctrl.c')
-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 bd72100a21d..fa06cf512ec 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, /* Check if the device control information and length match * the user supplied information. */ - __u32 flags; __le16 size; - __u8 inf; + __u8 _info; ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id, dev->intfnum, info->selector, (__u8 *)&size, 2); @@ -1345,7 +1344,7 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev, } ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id, - dev->intfnum, info->selector, &inf, 1); + dev->intfnum, info->selector, &_info, 1); if (ret < 0) { uvc_trace(UVC_TRACE_CONTROL, "GET_INFO failed on control %pUl/%u (%d).\n", @@ -1353,9 +1352,10 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev, return; } - flags = info->flags; - if (((flags & UVC_CONTROL_GET_CUR) && !(inf & (1 << 0))) || - ((flags & UVC_CONTROL_SET_CUR) && !(inf & (1 << 1)))) { + if (((info->flags & UVC_CONTROL_GET_CUR) && + !(_info & UVC_CONTROL_CAP_GET)) || + ((info->flags & UVC_CONTROL_SET_CUR) && + !(_info & UVC_CONTROL_CAP_SET))) { uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u flags " "don't match supported operations.\n", info->entity, info->selector); |