aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-07-23 05:58:31 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-30 15:26:31 -0400
commitbc147135bc410bdd9da684646af75a188d882d56 (patch)
tree33d48c996e453d36f58f9572b44508423fb487cb /drivers/media
parentcf784d554fdb94f21671830135dba56b507126cf (diff)
V4L/DVB (5900): usbvision: fix bugs [sg]_register functions
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index 868b6886fe7f..e3371f972240 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -517,6 +517,7 @@ static int vidioc_g_register (struct file *file, void *priv,
517 __FUNCTION__, errCode); 517 __FUNCTION__, errCode);
518 return errCode; 518 return errCode;
519 } 519 }
520 reg->val = errCode;
520 return 0; 521 return 0;
521} 522}
522 523
@@ -531,8 +532,8 @@ static int vidioc_s_register (struct file *file, void *priv,
531 if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 532 if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
532 return -EINVAL; 533 return -EINVAL;
533 /* NT100x has a 8-bit register space */ 534 /* NT100x has a 8-bit register space */
534 reg->val = (u8)usbvision_write_reg(usbvision, reg->reg&0xff, reg->val); 535 errCode = usbvision_write_reg(usbvision, reg->reg&0xff, reg->val);
535 if (reg->val < 0) { 536 if (errCode < 0) {
536 err("%s: VIDIOC_DBG_S_REGISTER failed: error %d", 537 err("%s: VIDIOC_DBG_S_REGISTER failed: error %d",
537 __FUNCTION__, errCode); 538 __FUNCTION__, errCode);
538 return errCode; 539 return errCode;