media: i2c: adv7180: Print the chip ID on probe

Improve the probe message by printing the chip ID version.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Fabio Estevam 2021-05-31 13:22:37 +02:00 committed by Mauro Carvalho Chehab
parent abb7c7c2f0
commit f7b96a9f35

View File

@ -1415,11 +1415,19 @@ 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);
mutex_lock(&state->mutex);
ret = adv7180_read(state, ADV7180_REG_IDENT);
mutex_unlock(&state->mutex);
if (ret < 0)
goto err_v4l2_async_unregister;
v4l_info(client, "chip id 0x%x found @ 0x%02x (%s)\n",
ret, client->addr, client->adapter->name);
return 0;
err_v4l2_async_unregister:
v4l2_async_unregister_subdev(sd);
err_free_irq:
if (state->irq > 0)
free_irq(client->irq, state);