diff options
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-ctrl.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c index 203f54cd18a1..1b992b847198 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c +++ b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c | |||
@@ -137,14 +137,12 @@ int pvr2_ctrl_get_min(struct pvr2_ctrl *cptr) | |||
137 | int pvr2_ctrl_get_def(struct pvr2_ctrl *cptr, int *valptr) | 137 | int pvr2_ctrl_get_def(struct pvr2_ctrl *cptr, int *valptr) |
138 | { | 138 | { |
139 | int ret = 0; | 139 | int ret = 0; |
140 | if (!cptr) return 0; | 140 | if (!cptr) return -EINVAL; |
141 | LOCK_TAKE(cptr->hdw->big_lock); do { | 141 | LOCK_TAKE(cptr->hdw->big_lock); do { |
142 | if (cptr->info->type == pvr2_ctl_int) { | 142 | if (cptr->info->get_def_value) { |
143 | if (cptr->info->get_def_value) { | 143 | ret = cptr->info->get_def_value(cptr, valptr); |
144 | ret = cptr->info->get_def_value(cptr, valptr); | 144 | } else { |
145 | } else { | 145 | *valptr = cptr->info->default_value; |
146 | *valptr = cptr->info->default_value; | ||
147 | } | ||
148 | } | 146 | } |
149 | } while(0); LOCK_GIVE(cptr->hdw->big_lock); | 147 | } while(0); LOCK_GIVE(cptr->hdw->big_lock); |
150 | return ret; | 148 | return ret; |