media: i2c: ov5645: Use local `dev` pointer for subdev device assignment
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Fri, 18 Oct 2024 15:32:22 +0000 (16:32 +0100)
committerHans Verkuil <hverkuil@xs4all.nl>
Thu, 7 Nov 2024 08:05:58 +0000 (09:05 +0100)
While assigning the subdev device pointer, use the local `dev` pointer
which is already extracted from the `i2c_client` pointer.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com>
Tested-by: Tommaso Merciai <tomm.merciai@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/ov5645.c

index 0c32bd2940ecf0e591964ef1ef8413e3c50e3717..6c1b301884fb22171ae232d25e867b6ef40ad434 100644 (file)
@@ -1180,7 +1180,7 @@ static int ov5645_probe(struct i2c_client *client)
        ov5645->sd.internal_ops = &ov5645_internal_ops;
        ov5645->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
        ov5645->pad.flags = MEDIA_PAD_FL_SOURCE;
-       ov5645->sd.dev = &client->dev;
+       ov5645->sd.dev = dev;
        ov5645->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
 
        ret = media_entity_pads_init(&ov5645->sd.entity, 1, &ov5645->pad);