diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-28 18:19:09 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-28 18:19:09 -0300 |
commit | 80f09f603d2001e9a765d66aa5fa5cf5f9f8ed44 (patch) | |
tree | 47ab08df25ce956b894779491385b3962b01fc77 /linux/drivers/media/video/pvrusb2 | |
parent | eb7519ddf0079fb5e8a48fe4ec4091ded9de495a (diff) | |
parent | 5a8d592ca3b750889157d08b2e349e036a678663 (diff) | |
download | mediapointer-dvb-s2-80f09f603d2001e9a765d66aa5fa5cf5f9f8ed44.tar.gz mediapointer-dvb-s2-80f09f603d2001e9a765d66aa5fa5cf5f9f8ed44.tar.bz2 |
merge: http://www.linuxtv.org/hg/~stoth/hvr1300-final
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 9 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index f6e5771f4..065ccb0bb 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -3245,7 +3245,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; @@ -3258,9 +3259,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/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c index 99daf3c1f..dbd2466ef 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c @@ -20,6 +20,7 @@ */ #include "compat.h" +#include <linux/kernel.h> #include "pvrusb2-i2c-core.h" #include "pvrusb2-hdw-internal.h" #include "pvrusb2-debug.h" @@ -90,7 +91,8 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) const struct pvr2_i2c_op *pvr2_i2c_get_op(unsigned int idx) { - if (idx >= sizeof(ops)/sizeof(ops[0])) return 0; + if (idx >= ARRAY_SIZE(ops)) + return NULL; return ops[idx]; } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 0da6c9ec6..6b72efd56 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -687,7 +687,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 |