]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: adv7180: Only print 'chip found' message on successful probe
authorFabio Estevam <festevam@gmail.com>
Fri, 11 Oct 2019 10:49:19 +0000 (07:49 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 24 Oct 2019 21:32:19 +0000 (18:32 -0300)
Currently the "chip found" message is shown even in the case where the
I2C address is wrongly passed in the device tree, or also in the case of
probe failure, which is misleading.

To avoid such problem, move this message after real I2C transactions
have been successfully made and we are certain that the adv7180 is
really present and probed.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/adv7180.c

index e780969cc2f26082001ca59cdd57a628acf1cc4f..6528e2343fc89f43dbea893a8850db74d7f65904 100644 (file)
@@ -1309,9 +1309,6 @@ static int adv7180_probe(struct i2c_client *client,
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
                return -EIO;
 
-       v4l_info(client, "chip found @ 0x%02x (%s)\n",
-                client->addr, client->adapter->name);
-
        state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
        if (state == NULL)
                return -ENOMEM;
@@ -1382,6 +1379,9 @@ static int adv7180_probe(struct i2c_client *client,
        if (ret)
                goto err_free_irq;
 
+       v4l_info(client, "chip found @ 0x%02x (%s)\n",
+                client->addr, client->adapter->name);
+
        return 0;
 
 err_free_irq: