V4L/DVB (11332): pvrusb2: Fix incorrect reporting of default value for non-integer...
authorMike Isely <isely@pobox.com>
Wed, 1 Apr 2009 04:49:57 +0000 (01:49 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 7 Apr 2009 00:43:51 +0000 (21:43 -0300)
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/pvrusb2/pvrusb2-ctrl.c

index 203f54cd18a16ac164e151166743b3a45327a95a..1b992b847198a486bc0eb62342d3d1b020c99919 100644 (file)
@@ -137,14 +137,12 @@ int pvr2_ctrl_get_min(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) {
-                       if (cptr->info->get_def_value) {
-                               ret = cptr->info->get_def_value(cptr, valptr);
-                       } else {
-                               *valptr = 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;