V4L/DVB (9372): Minor fixes to the saa7110 driver

* Apparently the author of the saa7110 driver was confused by the
  number of outputs returned by DECODER_GET_CAPABILITIES. Of course a
  decoder chip has no analog ouputs, but it must have at least one
  digital output.

* Fix an off-by-one error when checking the input value of
  DECODER_SET_INPUT.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Jean Delvare 2008-10-24 15:08:28 -03:00 committed by Mauro Carvalho Chehab
parent 0d0f1e0a1d
commit 8182ff69f8
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0-1)"); MODULE_PARM_DESC(debug, "Debug level (0-1)");
#define SAA7110_MAX_INPUT 9 /* 6 CVBS, 3 SVHS */ #define SAA7110_MAX_INPUT 9 /* 6 CVBS, 3 SVHS */
#define SAA7110_MAX_OUTPUT 0 /* its a decoder only */ #define SAA7110_MAX_OUTPUT 1 /* 1 YUV */
#define SAA7110_NR_REG 0x35 #define SAA7110_NR_REG 0x35
@ -327,7 +327,7 @@ saa7110_command (struct i2c_client *client,
case DECODER_SET_INPUT: case DECODER_SET_INPUT:
v = *(int *) arg; v = *(int *) arg;
if (v < 0 || v > SAA7110_MAX_INPUT) { if (v < 0 || v >= SAA7110_MAX_INPUT) {
v4l_dbg(1, debug, client, "input=%d not available\n", v); v4l_dbg(1, debug, client, "input=%d not available\n", v);
return -EINVAL; return -EINVAL;
} }