From 188f3457c21ac7869005021b56b4578293c644bb Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 16 Sep 2007 10:47:15 -0300 Subject: 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7115.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/saa7115.c') diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index ad60335544f..41e5e518a47 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c @@ -1459,7 +1459,7 @@ static int saa7115_probe(struct i2c_client *client) /* Check if the adapter supports the needed features */ if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) - return 0; + return -EIO; snprintf(client->name, sizeof(client->name) - 1, "saa7115"); @@ -1478,7 +1478,7 @@ static int saa7115_probe(struct i2c_client *client) if (memcmp(name, "1f711", 5)) { v4l_dbg(1, debug, client, "chip found @ 0x%x (ID %s) does not match a known saa711x chip.\n", client->addr << 1, name); - return 0; + return -ENODEV; } snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id); -- cgit v1.2.3