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/msp3400-driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/msp3400-driver.c') diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index f2946aca129..f4c14604b0b 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c @@ -812,7 +812,7 @@ static int msp_probe(struct i2c_client *client) if (msp_reset(client) == -1) { v4l_dbg(1, msp_debug, client, "msp3400 not found\n"); - return 0; + return -ENODEV; } state = kzalloc(sizeof(*state), GFP_KERNEL); @@ -844,7 +844,7 @@ static int msp_probe(struct i2c_client *client) if (state->rev1 == -1 || (state->rev1 == 0 && state->rev2 == 0)) { v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n"); kfree(state); - return 0; + return -ENODEV; } msp_set_audio(client); -- cgit v1.2.3