From: Lad Prabhakar Date: Mon, 31 Oct 2022 23:22:02 +0000 (+0000) Subject: media: i2c: ov5645: Call ov5645_entity_init_cfg() before registering the subdev X-Git-Tag: v6.2-rc1~125^2~235 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=87fab0eb25e98a2daa5824aff1adb05848332a9f;p=thirdparty%2Fkernel%2Flinux.git media: i2c: ov5645: Call ov5645_entity_init_cfg() before registering the subdev Make sure we call ov5645_entity_init_cfg() before registering the subdev to make sure default formats are set up. Suggested-by: Sakari Ailus Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index 0a889283da368..c8999fc4f26fd 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -1220,6 +1220,8 @@ static int ov5645_probe(struct i2c_client *client) pm_runtime_get_noresume(dev); pm_runtime_enable(dev); + ov5645_entity_init_cfg(&ov5645->sd, NULL); + ret = v4l2_async_register_subdev(&ov5645->sd); if (ret < 0) { dev_err(dev, "could not register v4l2 device\n"); @@ -1231,8 +1233,6 @@ static int ov5645_probe(struct i2c_client *client) pm_runtime_mark_last_busy(dev); pm_runtime_put_autosuspend(dev); - ov5645_entity_init_cfg(&ov5645->sd, NULL); - return 0; err_pm_runtime: