aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7127.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-09-16 09:47:15 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:01:27 -0500
commit188f3457c21ac7869005021b56b4578293c644bb (patch)
tree7002562a01698d2fa6070f1547e609f9b29cb163 /drivers/media/video/saa7127.c
parent6235168db8ed96c587e566be0dd72a77ca212693 (diff)
V4L/DVB (6465): Use correct error codes when chip is not recognized
If the chip isn't recognized, then the correct errors should be returned. The v4l2_i2c_attach() utility function will return 0 for all errors except -ENOMEM to provide proper compatibility support for the old I2C probing function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7127.c')
-rw-r--r--drivers/media/video/saa7127.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c
index 958ecc7168c3..0262acde0888 100644
--- a/drivers/media/video/saa7127.c
+++ b/drivers/media/video/saa7127.c
@@ -671,7 +671,7 @@ static int saa7127_probe(struct i2c_client *client)
671 671
672 /* Check if the adapter supports the needed features */ 672 /* Check if the adapter supports the needed features */
673 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 673 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
674 return 0; 674 return -EIO;
675 675
676 snprintf(client->name, sizeof(client->name) - 1, "saa7127"); 676 snprintf(client->name, sizeof(client->name) - 1, "saa7127");
677 677
@@ -685,12 +685,12 @@ static int saa7127_probe(struct i2c_client *client)
685 if ((saa7127_read(client, 0) & 0xe4) != 0 || 685 if ((saa7127_read(client, 0) & 0xe4) != 0 ||
686 (saa7127_read(client, 0x29) & 0x3f) != 0x1d) { 686 (saa7127_read(client, 0x29) & 0x3f) != 0x1d) {
687 v4l_dbg(1, debug, client, "saa7127 not found\n"); 687 v4l_dbg(1, debug, client, "saa7127 not found\n");
688 return 0; 688 return -ENODEV;
689 } 689 }
690 state = kzalloc(sizeof(struct saa7127_state), GFP_KERNEL); 690 state = kzalloc(sizeof(struct saa7127_state), GFP_KERNEL);
691 691
692 if (state == NULL) { 692 if (state == NULL) {
693 return (-ENOMEM); 693 return -ENOMEM;
694 } 694 }
695 695
696 i2c_set_clientdata(client, state); 696 i2c_set_clientdata(client, state);