Re: [PATCH 10/28] media: ov2680: Store dev instead of i2c_client in ov2680_dev

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

 



On Wed, Jun 07, 2023 at 06:46:54PM +0200, Hans de Goede wrote:
> Now that the cci_* register access helpers are used access to
> the i2c_client after probe() is no longer necessary.

And even if needed can be retrieved from the dev anyway.

> Directly store a struct device *dev pointing to &client->dev inside
> ov2680_dev to make the code simpler.

...

> +static int ov2680_v4l2_register(struct ov2680_dev *sensor, struct i2c_client *client)
>  {
>  	const struct v4l2_ctrl_ops *ops = &ov2680_ctrl_ops;
>  	struct ov2680_ctrls *ctrls = &sensor->ctrls;
>  	struct v4l2_ctrl_handler *hdl = &ctrls->handler;
>  	int ret = 0;
>  
> -	v4l2_i2c_subdev_init(&sensor->sd, sensor->i2c_client,
> -			     &ov2680_subdev_ops);
> +	v4l2_i2c_subdev_init(&sensor->sd, client, &ov2680_subdev_ops);

So, not sure if you prefer

	struct i2c_client *client = to_i2c_client(sensor->dev);

here instead of adding a new parameter.

-- 
With Best Regards,
Andy Shevchenko





[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