Re: [PATCH 3/3] media: i2c: adv7180: Print the chip ID on probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30.05.21 22:44, Fabio Estevam wrote:
> Improve the probe message by printing the chip ID version.
> 
> Signed-off-by: Fabio Estevam <festevam@xxxxxxxxx>

Reviewed-by: Frieder Schrempf <frieder.schrempf@xxxxxxxxxx>

> ---
>  drivers/media/i2c/adv7180.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
> index 2811f2c337fa..e5ef99f0460c 100644
> --- a/drivers/media/i2c/adv7180.c
> +++ b/drivers/media/i2c/adv7180.c
> @@ -1404,11 +1404,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);
> 



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux