Re: [PATCH v3 6/7] media: i2c: ov9282: Set v4l2 subdev name according to sensor model

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

 



Hi Alexander,

On Fri, Jul 22, 2022 at 03:19:46PM +0200, Alexander Stein wrote:
> To distinguish ov9281 & ov9282 the name has to be explicitly set.
> i2c_client already has the name parsed from the compatible.
> 
> Signed-off-by: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx>
> ---
>  drivers/media/i2c/ov9282.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
> index 352dbe21a902..dbc0a4cd060f 100644
> --- a/drivers/media/i2c/ov9282.c
> +++ b/drivers/media/i2c/ov9282.c
> @@ -1047,6 +1047,7 @@ static int ov9282_probe(struct i2c_client *client)
>  
>  	/* Initialize subdev */
>  	v4l2_i2c_subdev_init(&ov9282->sd, client, &ov9282_subdev_ops);
> +	v4l2_i2c_subdev_set_name(&ov9282->sd, client, client->name, NULL);
>  

Could you instead do this based on the compatible string in the driver,
using device_get_match_data()? The approach works on non-OF systems, too.

>  	ret = ov9282_parse_hw_config(ov9282);
>  	if (ret) {

-- 
Regards,

Sakari Ailus



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux