V4L/DVB (11747): pvrusb2: Bump up version advertised through v4l interface
[safe/jmp/linux-2.6] / drivers / media / video / pvrusb2 / pvrusb2-ctrl.c
index 91a42f2..1b992b8 100644 (file)
@@ -1,6 +1,5 @@
 /*
  *
- *  $Id$
  *
  *  Copyright (C) 2005 Mike Isely <isely@pobox.com>
  *
@@ -135,13 +134,15 @@ int pvr2_ctrl_get_min(struct pvr2_ctrl *cptr)
 
 
 /* Retrieve control's default value (any type) */
-int pvr2_ctrl_get_def(struct pvr2_ctrl *cptr)
+int pvr2_ctrl_get_def(struct pvr2_ctrl *cptr, int *valptr)
 {
        int ret = 0;
-       if (!cptr) return 0;
+       if (!cptr) return -EINVAL;
        LOCK_TAKE(cptr->hdw->big_lock); do {
-               if (cptr->info->type == pvr2_ctl_int) {
-                       ret = cptr->info->default_value;
+               if (cptr->info->get_def_value) {
+                       ret = cptr->info->get_def_value(cptr, valptr);
+               } else {
+                       *valptr = cptr->info->default_value;
                }
        } while(0); LOCK_GIVE(cptr->hdw->big_lock);
        return ret;