aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r--drivers/media/video/v4l2-common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index a523af78bdb1..0c511839f7ee 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -637,13 +637,17 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl)
637EXPORT_SYMBOL(v4l2_ctrl_query_fill_std); 637EXPORT_SYMBOL(v4l2_ctrl_query_fill_std);
638 638
639/* Fill in a struct v4l2_querymenu based on the struct v4l2_queryctrl and 639/* Fill in a struct v4l2_querymenu based on the struct v4l2_queryctrl and
640 the menu. The qctrl pointer may be NULL, in which case it is ignored. */ 640 the menu. The qctrl pointer may be NULL, in which case it is ignored.
641 If menu_items is NULL, then the menu items are retrieved using
642 v4l2_ctrl_get_menu. */
641int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, struct v4l2_queryctrl *qctrl, 643int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, struct v4l2_queryctrl *qctrl,
642 const char **menu_items) 644 const char **menu_items)
643{ 645{
644 int i; 646 int i;
645 647
646 qmenu->reserved = 0; 648 qmenu->reserved = 0;
649 if (menu_items == NULL)
650 menu_items = v4l2_ctrl_get_menu(qmenu->id);
647 if (menu_items == NULL || 651 if (menu_items == NULL ||
648 (qctrl && (qmenu->index < qctrl->minimum || qmenu->index > qctrl->maximum))) 652 (qctrl && (qmenu->index < qctrl->minimum || qmenu->index > qctrl->maximum)))
649 return -EINVAL; 653 return -EINVAL;