Skip to content

Commit

Permalink
media: qcom: Initialise V4L2 async notifier later
Browse files Browse the repository at this point in the history
[ Upstream commit 5651bab ]

Initialise V4L2 async notifier and parse DT for async sub-devices later,
just before registering the notifier. This way the device can be made
available to the V4L2 async framework from the notifier init time onwards.
A subsequent patch will add struct v4l2_device as an argument to
v4l2_async_nf_init().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Stable-dep-of: f69791c ("media: qcom: camss: Fix genpd cleanup")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Sakari Ailus authored and gregkh committed Dec 3, 2023
1 parent 153a439 commit fdfcdf9
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions drivers/media/platform/qcom/camss/camss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,14 +1613,6 @@ static int camss_probe(struct platform_device *pdev)
if (!camss->vfe)
return -ENOMEM;

v4l2_async_nf_init(&camss->notifier);

num_subdevs = camss_of_parse_ports(camss);
if (num_subdevs < 0) {
ret = num_subdevs;
goto err_cleanup;
}

ret = camss_icc_get(camss);
if (ret < 0)
goto err_cleanup;
Expand Down Expand Up @@ -1652,9 +1644,17 @@ static int camss_probe(struct platform_device *pdev)
goto err_cleanup;
}

v4l2_async_nf_init(&camss->notifier);

num_subdevs = camss_of_parse_ports(camss);
if (num_subdevs < 0) {
ret = num_subdevs;
goto err_cleanup;
}

ret = camss_register_entities(camss);
if (ret < 0)
goto err_register_entities;
goto err_cleanup;

if (num_subdevs) {
camss->notifier.ops = &camss_subdev_notifier_ops;
Expand Down Expand Up @@ -1689,9 +1689,8 @@ static int camss_probe(struct platform_device *pdev)

err_register_subdevs:
camss_unregister_entities(camss);
err_register_entities:
v4l2_device_unregister(&camss->v4l2_dev);
err_cleanup:
v4l2_device_unregister(&camss->v4l2_dev);
v4l2_async_nf_cleanup(&camss->notifier);

return ret;
Expand Down

0 comments on commit fdfcdf9

Please sign in to comment.