diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-09-16 09:47:15 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:01:27 -0500 |
commit | 188f3457c21ac7869005021b56b4578293c644bb (patch) | |
tree | 7002562a01698d2fa6070f1547e609f9b29cb163 /drivers/media/video/cx25840 | |
parent | 6235168db8ed96c587e566be0dd72a77ca212693 (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/cx25840')
-rw-r--r-- | drivers/media/video/cx25840/cx25840-core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 1556e2fad4c1..6d2ca822a638 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -1078,6 +1078,10 @@ static int cx25840_probe(struct i2c_client *client) | |||
1078 | u32 id; | 1078 | u32 id; |
1079 | u16 device_id; | 1079 | u16 device_id; |
1080 | 1080 | ||
1081 | /* Check if the adapter supports the needed features */ | ||
1082 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | ||
1083 | return -EIO; | ||
1084 | |||
1081 | v4l_dbg(1, cx25840_debug, client, "detecting cx25840 client on address 0x%x\n", client->addr << 1); | 1085 | v4l_dbg(1, cx25840_debug, client, "detecting cx25840 client on address 0x%x\n", client->addr << 1); |
1082 | 1086 | ||
1083 | device_id = cx25840_read(client, 0x101) << 8; | 1087 | device_id = cx25840_read(client, 0x101) << 8; |
@@ -1093,7 +1097,7 @@ static int cx25840_probe(struct i2c_client *client) | |||
1093 | } | 1097 | } |
1094 | else { | 1098 | else { |
1095 | v4l_dbg(1, cx25840_debug, client, "cx25840 not found\n"); | 1099 | v4l_dbg(1, cx25840_debug, client, "cx25840 not found\n"); |
1096 | return 0; | 1100 | return -ENODEV; |
1097 | } | 1101 | } |
1098 | 1102 | ||
1099 | state = kzalloc(sizeof(struct cx25840_state), GFP_KERNEL); | 1103 | state = kzalloc(sizeof(struct cx25840_state), GFP_KERNEL); |