Commit 6d98816f authored by Mike Isely's avatar Mike Isely Committed by Mauro Carvalho Chehab

V4L/DVB (4675): Pvrusb2: Fix VIDIOC_INT_[G|S]_REGISTER so that it actually works now

Signed-off-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent ab9caf9e
...@@ -3140,7 +3140,8 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw, ...@@ -3140,7 +3140,8 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
struct list_head *item; struct list_head *item;
struct pvr2_i2c_client *cp; struct pvr2_i2c_client *cp;
struct v4l2_register req; struct v4l2_register req;
int stat; int stat = 0;
int okFl = 0;
req.i2c_id = chip_id; req.i2c_id = chip_id;
req.reg = reg_id; req.reg = reg_id;
...@@ -3153,9 +3154,13 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw, ...@@ -3153,9 +3154,13 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
cp,(setFl ? VIDIOC_INT_S_REGISTER : cp,(setFl ? VIDIOC_INT_S_REGISTER :
VIDIOC_INT_G_REGISTER),&req); VIDIOC_INT_G_REGISTER),&req);
if (!setFl) *val_ptr = req.val; if (!setFl) *val_ptr = req.val;
return stat; okFl = !0;
break;
} }
} while (0); mutex_unlock(&hdw->i2c_list_lock); } while (0); mutex_unlock(&hdw->i2c_list_lock);
if (okFl) {
return stat;
}
return -EINVAL; return -EINVAL;
#else #else
return -ENOSYS; return -ENOSYS;
......
...@@ -671,7 +671,7 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, ...@@ -671,7 +671,7 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
ret = pvr2_hdw_register_access( ret = pvr2_hdw_register_access(
hdw,req->i2c_id,req->reg, hdw,req->i2c_id,req->reg,
cmd == VIDIOC_INT_S_REGISTER,&val); cmd == VIDIOC_INT_S_REGISTER,&val);
if (cmd == 0) req->val = val; if (cmd == VIDIOC_INT_G_REGISTER) req->val = val;
break; break;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment