]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/v4l2-common.c
V4L/DVB (8639): saa6752hs: cleanup and add AC-3 support
[linux-2.6-omap-h63xx.git] / drivers / media / video / v4l2-common.c
index a523af78bdb16b035dc347f1051245577bb0373c..0c511839f7ee1bfbee5e08c79f64b2bacbd8fda3 100644 (file)
@@ -637,13 +637,17 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl)
 EXPORT_SYMBOL(v4l2_ctrl_query_fill_std);
 
 /* Fill in a struct v4l2_querymenu based on the struct v4l2_queryctrl and
-   the menu. The qctrl pointer may be NULL, in which case it is ignored. */
+   the menu. The qctrl pointer may be NULL, in which case it is ignored.
+   If menu_items is NULL, then the menu items are retrieved using
+   v4l2_ctrl_get_menu. */
 int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, struct v4l2_queryctrl *qctrl,
               const char **menu_items)
 {
        int i;
 
        qmenu->reserved = 0;
+       if (menu_items == NULL)
+               menu_items = v4l2_ctrl_get_menu(qmenu->id);
        if (menu_items == NULL ||
            (qctrl && (qmenu->index < qctrl->minimum || qmenu->index > qctrl->maximum)))
                return -EINVAL;