summaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c9
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 11a327d167be..3d8cd0daf6a9 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -3140,7 +3140,8 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
struct list_head *item;
struct pvr2_i2c_client *cp;
struct v4l2_register req;
- int stat;
+ int stat = 0;
+ int okFl = 0;
req.i2c_id = chip_id;
req.reg = reg_id;
@@ -3153,9 +3154,13 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
cp,(setFl ? VIDIOC_INT_S_REGISTER :
VIDIOC_INT_G_REGISTER),&req);
if (!setFl) *val_ptr = req.val;
- return stat;
+ okFl = !0;
+ break;
}
} while (0); mutex_unlock(&hdw->i2c_list_lock);
+ if (okFl) {
+ return stat;
+ }
return -EINVAL;
#else
return -ENOSYS;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 49186984a0d7..97e974d9b9c3 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -671,7 +671,7 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
ret = pvr2_hdw_register_access(
hdw,req->i2c_id,req->reg,
cmd == VIDIOC_INT_S_REGISTER,&val);
- if (cmd == 0) req->val = val;
+ if (cmd == VIDIOC_INT_G_REGISTER) req->val = val;
break;
}
#endif
OpenPOWER on IntegriCloud