From 3f466835bc047f9f83f11ce8dcecc3021de4dec2 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 16 Sep 2007 15:47:15 +0200 Subject: Use correct error codes when chip is not recognized. From: Hans Verkuil 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 --- linux/drivers/media/video/cs53l32a.c | 2 +- linux/drivers/media/video/cx25840/cx25840-core.c | 6 +++++- linux/drivers/media/video/msp3400-driver.c | 4 ++-- linux/drivers/media/video/saa7115.c | 4 ++-- linux/drivers/media/video/saa7127.c | 6 +++--- linux/drivers/media/video/tlv320aic23b.c | 2 +- linux/drivers/media/video/upd64031a.c | 2 +- linux/drivers/media/video/upd64083.c | 2 +- linux/drivers/media/video/v4l2-common.c | 2 +- linux/drivers/media/video/vp27smpx.c | 2 +- linux/drivers/media/video/wm8739.c | 4 ++++ 11 files changed, 22 insertions(+), 14 deletions(-) --- linux/drivers/media/video/wm8739.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linux/drivers/media/video/wm8739.c') diff --git a/linux/drivers/media/video/wm8739.c b/linux/drivers/media/video/wm8739.c index 953c47ed4..4b5956a8f 100644 --- a/linux/drivers/media/video/wm8739.c +++ b/linux/drivers/media/video/wm8739.c @@ -276,6 +276,10 @@ static int wm8739_probe(struct i2c_client *client) { struct wm8739_state *state; + /* Check if the adapter supports the needed features */ + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) + return -EIO; + v4l_info(client, "chip found @ 0x%x (%s)\n", client->addr << 1, client->adapter->name); state = kmalloc(sizeof(struct wm8739_state), GFP_KERNEL); -- cgit v1.2.3