diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-07-23 02:58:31 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2007-07-23 02:58:31 -0700 |
commit | 793b5a0484a44d294066a82ec4049d3a5185a8cc (patch) | |
tree | 510ea6c4f4ea4c6546df3052848d98f47107fb4f /linux/drivers/media | |
parent | 63e951dfac4a817b5686f39e13e5b0d8b9e456b7 (diff) | |
download | mediapointer-dvb-s2-793b5a0484a44d294066a82ec4049d3a5185a8cc.tar.gz mediapointer-dvb-s2-793b5a0484a44d294066a82ec4049d3a5185a8cc.tar.bz2 |
usbvision: fix bugs [sg]_register functions
From: Trent Piepho <xyzzy@speakeasy.org>
s_register was assigning the return code to (unsigned)reg->val, rather than
errCode, which it what it would return. Except reg->val can't be < 0, so it
would never actually return an error.
g_register never actually put the value it read into reg->val.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/usbvision/usbvision-video.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/linux/drivers/media/video/usbvision/usbvision-video.c b/linux/drivers/media/video/usbvision/usbvision-video.c index c5314a15c..ac6c0b1d5 100644 --- a/linux/drivers/media/video/usbvision/usbvision-video.c +++ b/linux/drivers/media/video/usbvision/usbvision-video.c @@ -550,6 +550,7 @@ static int vidioc_g_register (struct file *file, void *priv, __FUNCTION__, errCode); return errCode; } + reg->val = errCode; return 0; } @@ -564,8 +565,8 @@ static int vidioc_s_register (struct file *file, void *priv, if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) return -EINVAL; /* NT100x has a 8-bit register space */ - reg->val = (u8)usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); - if (reg->val < 0) { + errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); + if (errCode < 0) { err("%s: VIDIOC_DBG_S_REGISTER failed: error %d", __FUNCTION__, errCode); return errCode; |