Set the v4l2_device already in async notifier init, so struct device
related to it will be available before the notifier is registered. This
requires separating notifier initialisation into two functions, one that
takes v4l2_device as its argument, v4l2_async_nf_init and
v4l2_async_subdev_nf_init, for sub-device notifiers. Registering the
notifier will use a single function, v4l2_async_nf_register.
This is done in order to make struct device available earlier, during
construction of the async connections, for sensible debug prints.
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>
53 files changed:
- v4l2_async_nf_init(&priv->notifier);
+ v4l2_async_subdev_nf_init(&priv->notifier, &priv->sd);
asd = v4l2_async_nf_add_fwnode_remote(&priv->notifier, ep_fwnode,
struct v4l2_async_connection);
asd = v4l2_async_nf_add_fwnode_remote(&priv->notifier, ep_fwnode,
struct v4l2_async_connection);
priv->notifier.ops = &ub913_notify_ops;
priv->notifier.ops = &ub913_notify_ops;
- ret = v4l2_async_subdev_nf_register(&priv->sd, &priv->notifier);
+ ret = v4l2_async_nf_register(&priv->notifier);
if (ret) {
dev_err(dev, "Failed to register subdev_notifier");
v4l2_async_nf_cleanup(&priv->notifier);
if (ret) {
dev_err(dev, "Failed to register subdev_notifier");
v4l2_async_nf_cleanup(&priv->notifier);
- v4l2_async_nf_init(&priv->notifier);
+ v4l2_async_subdev_nf_init(&priv->notifier, &priv->sd);
asd = v4l2_async_nf_add_fwnode_remote(&priv->notifier, ep_fwnode,
struct v4l2_async_connection);
asd = v4l2_async_nf_add_fwnode_remote(&priv->notifier, ep_fwnode,
struct v4l2_async_connection);
priv->notifier.ops = &ub953_notify_ops;
priv->notifier.ops = &ub953_notify_ops;
- ret = v4l2_async_subdev_nf_register(&priv->sd, &priv->notifier);
+ ret = v4l2_async_nf_register(&priv->notifier);
if (ret) {
dev_err(dev, "Failed to register subdev_notifier");
v4l2_async_nf_cleanup(&priv->notifier);
if (ret) {
dev_err(dev, "Failed to register subdev_notifier");
v4l2_async_nf_cleanup(&priv->notifier);
- v4l2_async_nf_init(&priv->notifier);
+ v4l2_async_subdev_nf_init(&priv->notifier, &priv->sd);
for (i = 0; i < priv->hw_data->num_rxports; i++) {
struct ub960_rxport *rxport = priv->rxports[i];
for (i = 0; i < priv->hw_data->num_rxports; i++) {
struct ub960_rxport *rxport = priv->rxports[i];
priv->notifier.ops = &ub960_notify_ops;
priv->notifier.ops = &ub960_notify_ops;
- ret = v4l2_async_subdev_nf_register(&priv->sd, &priv->notifier);
+ ret = v4l2_async_nf_register(&priv->notifier);
if (ret) {
dev_err(dev, "Failed to register subdev_notifier");
v4l2_async_nf_cleanup(&priv->notifier);
if (ret) {
dev_err(dev, "Failed to register subdev_notifier");
v4l2_async_nf_cleanup(&priv->notifier);
if (!priv->nsources)
return 0;
if (!priv->nsources)
return 0;
- v4l2_async_nf_init(&priv->notifier);
+ v4l2_async_subdev_nf_init(&priv->notifier, &priv->sd);
for_each_source(priv, source) {
unsigned int i = to_index(priv, source);
for_each_source(priv, source) {
unsigned int i = to_index(priv, source);
priv->notifier.ops = &max9286_notify_ops;
priv->notifier.ops = &max9286_notify_ops;
- ret = v4l2_async_subdev_nf_register(&priv->sd, &priv->notifier);
+ ret = v4l2_async_nf_register(&priv->notifier);
if (ret) {
dev_err(dev, "Failed to register subdev_notifier");
v4l2_async_nf_cleanup(&priv->notifier);
if (ret) {
dev_err(dev, "Failed to register subdev_notifier");
v4l2_async_nf_cleanup(&priv->notifier);
bridge->rx = ep;
/* register async notifier so we get noticed when sensor is connected */
bridge->rx = ep;
/* register async notifier so we get noticed when sensor is connected */
- v4l2_async_nf_init(&bridge->notifier);
+ v4l2_async_subdev_nf_init(&bridge->notifier, &bridge->sd);
asd = v4l2_async_nf_add_fwnode_remote(&bridge->notifier,
of_fwnode_handle(ep_node),
struct v4l2_async_connection);
asd = v4l2_async_nf_add_fwnode_remote(&bridge->notifier,
of_fwnode_handle(ep_node),
struct v4l2_async_connection);
}
bridge->notifier.ops = &mipid02_notifier_ops;
}
bridge->notifier.ops = &mipid02_notifier_ops;
- ret = v4l2_async_subdev_nf_register(&bridge->sd, &bridge->notifier);
+ ret = v4l2_async_nf_register(&bridge->notifier);
if (ret)
v4l2_async_nf_cleanup(&bridge->notifier);
if (ret)
v4l2_async_nf_cleanup(&bridge->notifier);
- v4l2_async_nf_init(&tc358746->notifier);
+ v4l2_async_subdev_nf_init(&tc358746->notifier, &tc358746->sd);
asd = v4l2_async_nf_add_fwnode_remote(&tc358746->notifier, ep,
struct v4l2_async_connection);
fwnode_handle_put(ep);
asd = v4l2_async_nf_add_fwnode_remote(&tc358746->notifier, ep,
struct v4l2_async_connection);
fwnode_handle_put(ep);
tc358746->notifier.ops = &tc358746_notify_ops;
tc358746->notifier.ops = &tc358746_notify_ops;
- err = v4l2_async_subdev_nf_register(&tc358746->sd, &tc358746->notifier);
+ err = v4l2_async_nf_register(&tc358746->notifier);
if (err)
goto err_cleanup;
if (err)
goto err_cleanup;
* suspend.
*/
cio2->notifier.ops = &cio2_async_ops;
* suspend.
*/
cio2->notifier.ops = &cio2_async_ops;
- ret = v4l2_async_nf_register(&cio2->v4l2_dev, &cio2->notifier);
+ ret = v4l2_async_nf_register(&cio2->notifier);
if (ret)
dev_err(dev, "failed to register async notifier : %d\n", ret);
if (ret)
dev_err(dev, "failed to register async notifier : %d\n", ret);
if (r)
goto fail_v4l2_device_unregister;
if (r)
goto fail_v4l2_device_unregister;
- v4l2_async_nf_init(&cio2->notifier);
+ v4l2_async_nf_init(&cio2->notifier, &cio2->v4l2_dev);
/* Register notifier for subdevices we care */
r = cio2_parse_firmware(cio2);
/* Register notifier for subdevices we care */
r = cio2_parse_firmware(cio2);
- v4l2_async_nf_init(&isi->notifier);
+ v4l2_async_nf_init(&isi->notifier, &isi->v4l2_dev);
asd = v4l2_async_nf_add_fwnode_remote(&isi->notifier,
of_fwnode_handle(ep),
asd = v4l2_async_nf_add_fwnode_remote(&isi->notifier,
of_fwnode_handle(ep),
isi->notifier.ops = &isi_graph_notify_ops;
isi->notifier.ops = &isi_graph_notify_ops;
- ret = v4l2_async_nf_register(&isi->v4l2_dev, &isi->notifier);
+ ret = v4l2_async_nf_register(&isi->notifier);
if (ret < 0) {
dev_err(isi->dev, "Notifier registration failed\n");
v4l2_async_nf_cleanup(&isi->notifier);
if (ret < 0) {
dev_err(isi->dev, "Notifier registration failed\n");
v4l2_async_nf_cleanup(&isi->notifier);
- v4l2_async_nf_init(&csi2rx->notifier);
+ v4l2_async_subdev_nf_init(&csi2rx->notifier, &csi2rx->subdev);
asd = v4l2_async_nf_add_fwnode_remote(&csi2rx->notifier, fwh,
struct v4l2_async_connection);
asd = v4l2_async_nf_add_fwnode_remote(&csi2rx->notifier, fwh,
struct v4l2_async_connection);
csi2rx->notifier.ops = &csi2rx_notifier_ops;
csi2rx->notifier.ops = &csi2rx_notifier_ops;
- ret = v4l2_async_subdev_nf_register(&csi2rx->subdev, &csi2rx->notifier);
+ ret = v4l2_async_nf_register(&csi2rx->notifier);
if (ret)
v4l2_async_nf_cleanup(&csi2rx->notifier);
if (ret)
v4l2_async_nf_cleanup(&csi2rx->notifier);
- v4l2_async_nf_init(&pcdev->notifier);
+ v4l2_async_nf_init(&pcdev->notifier, &pcdev->v4l2_dev);
pcdev->res = res;
pcdev->pdata = pdev->dev.platform_data;
if (pcdev->pdata) {
pcdev->res = res;
pcdev->pdata = pdev->dev.platform_data;
if (pcdev->pdata) {
}
pcdev->notifier.ops = &pxa_camera_sensor_ops;
}
pcdev->notifier.ops = &pxa_camera_sensor_ops;
- err = v4l2_async_nf_register(&pcdev->v4l2_dev, &pcdev->notifier);
+ err = v4l2_async_nf_register(&pcdev->notifier);
if (err)
goto exit_deactivate;
if (err)
goto exit_deactivate;
if (ret)
goto out_smbus_shutdown;
if (ret)
goto out_smbus_shutdown;
- v4l2_async_nf_init(&mcam->notifier);
+ v4l2_async_nf_init(&mcam->notifier, &mcam->v4l2_dev);
asd = v4l2_async_nf_add_i2c(&mcam->notifier,
i2c_adapter_id(cam->i2c_adapter),
asd = v4l2_async_nf_add_i2c(&mcam->notifier,
i2c_adapter_id(cam->i2c_adapter),
cam->mbus_code = mcam_def_mbus_code;
cam->notifier.ops = &mccic_notify_ops;
cam->mbus_code = mcam_def_mbus_code;
cam->notifier.ops = &mccic_notify_ops;
- ret = v4l2_async_nf_register(&cam->v4l2_dev, &cam->notifier);
+ ret = v4l2_async_nf_register(&cam->notifier);
if (ret < 0) {
cam_warn(cam, "failed to register a sensor notifier");
goto out;
if (ret < 0) {
cam_warn(cam, "failed to register a sensor notifier");
goto out;
- v4l2_async_nf_init(&mcam->notifier);
+ v4l2_async_nf_init(&mcam->notifier, &mcam->v4l2_dev);
asd = v4l2_async_nf_add_fwnode_remote(&mcam->notifier, ep,
struct v4l2_async_connection);
asd = v4l2_async_nf_add_fwnode_remote(&mcam->notifier, ep,
struct v4l2_async_connection);
struct v4l2_async_connection *asd;
int ret = 0;
struct v4l2_async_connection *asd;
int ret = 0;
- v4l2_async_nf_init(&csi2dc->notifier);
+ v4l2_async_subdev_nf_init(&csi2dc->notifier, &csi2dc->csi2dc_sd);
asd = v4l2_async_nf_add_fwnode_remote(&csi2dc->notifier,
input_fwnode,
asd = v4l2_async_nf_add_fwnode_remote(&csi2dc->notifier,
input_fwnode,
csi2dc->notifier.ops = &csi2dc_async_ops;
csi2dc->notifier.ops = &csi2dc_async_ops;
- ret = v4l2_async_subdev_nf_register(&csi2dc->csi2dc_sd,
- &csi2dc->notifier);
+ ret = v4l2_async_nf_register(&csi2dc->notifier);
if (ret) {
dev_err(csi2dc->dev, "fail to register async notifier: %d\n",
ret);
if (ret) {
dev_err(csi2dc->dev, "fail to register async notifier: %d\n",
ret);
struct fwnode_handle *fwnode =
of_fwnode_handle(subdev_entity->epn);
struct fwnode_handle *fwnode =
of_fwnode_handle(subdev_entity->epn);
- v4l2_async_nf_init(&subdev_entity->notifier);
+ v4l2_async_nf_init(&subdev_entity->notifier, &isc->v4l2_dev);
asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
fwnode,
asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
fwnode,
subdev_entity->notifier.ops = µchip_isc_async_ops;
subdev_entity->notifier.ops = µchip_isc_async_ops;
- ret = v4l2_async_nf_register(&isc->v4l2_dev,
- &subdev_entity->notifier);
+ ret = v4l2_async_nf_register(&subdev_entity->notifier);
if (ret) {
dev_err(dev, "fail to register async notifier\n");
goto cleanup_subdev;
if (ret) {
dev_err(dev, "fail to register async notifier\n");
goto cleanup_subdev;
struct fwnode_handle *fwnode =
of_fwnode_handle(subdev_entity->epn);
struct fwnode_handle *fwnode =
of_fwnode_handle(subdev_entity->epn);
- v4l2_async_nf_init(&subdev_entity->notifier);
+ v4l2_async_nf_init(&subdev_entity->notifier, &isc->v4l2_dev);
asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
fwnode,
asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
fwnode,
subdev_entity->notifier.ops = µchip_isc_async_ops;
subdev_entity->notifier.ops = µchip_isc_async_ops;
- ret = v4l2_async_nf_register(&isc->v4l2_dev,
- &subdev_entity->notifier);
+ ret = v4l2_async_nf_register(&subdev_entity->notifier);
if (ret) {
dev_err(dev, "fail to register async notifier\n");
goto cleanup_subdev;
if (ret) {
dev_err(dev, "fail to register async notifier\n");
goto cleanup_subdev;
- v4l2_async_nf_init(&csis->notifier);
+ v4l2_async_subdev_nf_init(&csis->notifier, &csis->sd);
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(csis->dev), 0, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(csis->dev), 0, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
csis->notifier.ops = &mipi_csis_notify_ops;
csis->notifier.ops = &mipi_csis_notify_ops;
- ret = v4l2_async_subdev_nf_register(&csis->sd, &csis->notifier);
+ ret = v4l2_async_nf_register(&csis->notifier);
struct fwnode_handle *ep;
int ret;
struct fwnode_handle *ep;
int ret;
- v4l2_async_nf_init(&csi->notifier);
+ v4l2_async_nf_init(&csi->notifier, &csi->v4l2_dev);
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(csi->dev), 0, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(csi->dev), 0, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
csi->notifier.ops = &imx7_csi_notify_ops;
csi->notifier.ops = &imx7_csi_notify_ops;
- ret = v4l2_async_nf_register(&csi->v4l2_dev, &csi->notifier);
+ ret = v4l2_async_nf_register(&csi->notifier);
}
/* Initialize, fill and register the async notifier. */
}
/* Initialize, fill and register the async notifier. */
- v4l2_async_nf_init(&isi->notifier);
+ v4l2_async_nf_init(&isi->notifier, v4l2_dev);
isi->notifier.ops = &mxc_isi_async_notifier_ops;
for (i = 0; i < isi->pdata->num_ports; ++i) {
isi->notifier.ops = &mxc_isi_async_notifier_ops;
for (i = 0; i < isi->pdata->num_ports; ++i) {
- ret = v4l2_async_nf_register(v4l2_dev, &isi->notifier);
+ ret = v4l2_async_nf_register(&isi->notifier);
if (ret < 0) {
dev_err(isi->dev,
"Failed to register async notifier: %d\n", ret);
if (ret < 0) {
dev_err(isi->dev,
"Failed to register async notifier: %d\n", ret);
- v4l2_async_nf_init(&state->notifier);
+ v4l2_async_subdev_nf_init(&state->notifier, &state->sd);
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(state->dev), 0, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(state->dev), 0, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
state->notifier.ops = &imx8mq_mipi_csi_notify_ops;
state->notifier.ops = &imx8mq_mipi_csi_notify_ops;
- ret = v4l2_async_subdev_nf_register(&state->sd, &state->notifier);
+ ret = v4l2_async_nf_register(&state->notifier);
- v4l2_async_nf_init(&camss->notifier);
+ v4l2_async_nf_init(&camss->notifier, &camss->v4l2_dev);
num_subdevs = camss_of_parse_ports(camss);
if (num_subdevs < 0) {
num_subdevs = camss_of_parse_ports(camss);
if (num_subdevs < 0) {
if (num_subdevs) {
camss->notifier.ops = &camss_subdev_notifier_ops;
if (num_subdevs) {
camss->notifier.ops = &camss_subdev_notifier_ops;
- ret = v4l2_async_nf_register(&camss->v4l2_dev,
- &camss->notifier);
+ ret = v4l2_async_nf_register(&camss->notifier);
if (ret) {
dev_err(dev,
"Failed to register async subdev nodes: %d\n",
if (ret) {
dev_err(dev,
"Failed to register async subdev nodes: %d\n",
dev_dbg(isp->dev, "Found '%pOF'\n", to_of_node(fwnode));
dev_dbg(isp->dev, "Found '%pOF'\n", to_of_node(fwnode));
- v4l2_async_nf_init(&isp->notifier);
+ v4l2_async_subdev_nf_init(&isp->notifier, &isp->subdev);
isp->notifier.ops = &risp_notify_ops;
asd = v4l2_async_nf_add_fwnode(&isp->notifier, fwnode,
isp->notifier.ops = &risp_notify_ops;
asd = v4l2_async_nf_add_fwnode(&isp->notifier, fwnode,
if (IS_ERR(asd))
return PTR_ERR(asd);
if (IS_ERR(asd))
return PTR_ERR(asd);
- ret = v4l2_async_subdev_nf_register(&isp->subdev, &isp->notifier);
+ ret = v4l2_async_nf_register(&isp->notifier);
if (ret)
v4l2_async_nf_cleanup(&isp->notifier);
if (ret)
v4l2_async_nf_cleanup(&isp->notifier);
mutex_unlock(&vin->group->lock);
mutex_unlock(&vin->group->lock);
- v4l2_async_nf_init(&vin->group->notifier);
+ v4l2_async_nf_init(&vin->group->notifier, &vin->v4l2_dev);
/*
* Some subdevices may overlap but the parser function can handle it and
/*
* Some subdevices may overlap but the parser function can handle it and
return 0;
vin->group->notifier.ops = &rvin_group_notify_ops;
return 0;
vin->group->notifier.ops = &rvin_group_notify_ops;
- ret = v4l2_async_nf_register(&vin->v4l2_dev, &vin->group->notifier);
+ ret = v4l2_async_nf_register(&vin->group->notifier);
if (ret < 0) {
vin_err(vin, "Notifier registration failed\n");
v4l2_async_nf_cleanup(&vin->group->notifier);
if (ret < 0) {
vin_err(vin, "Notifier registration failed\n");
v4l2_async_nf_cleanup(&vin->group->notifier);
- v4l2_async_nf_init(&vin->notifier);
+ v4l2_async_nf_init(&vin->notifier, &vin->v4l2_dev);
ret = rvin_parallel_parse_of(vin);
if (ret)
ret = rvin_parallel_parse_of(vin);
if (ret)
to_of_node(vin->parallel.asc->match.fwnode));
vin->notifier.ops = &rvin_parallel_notify_ops;
to_of_node(vin->parallel.asc->match.fwnode));
vin->notifier.ops = &rvin_parallel_notify_ops;
- ret = v4l2_async_nf_register(&vin->v4l2_dev, &vin->notifier);
+ ret = v4l2_async_nf_register(&vin->notifier);
if (ret < 0) {
vin_err(vin, "Notifier registration failed\n");
v4l2_async_nf_cleanup(&vin->notifier);
if (ret < 0) {
vin_err(vin, "Notifier registration failed\n");
v4l2_async_nf_cleanup(&vin->notifier);
dev_dbg(priv->dev, "Found '%pOF'\n", to_of_node(fwnode));
dev_dbg(priv->dev, "Found '%pOF'\n", to_of_node(fwnode));
- v4l2_async_nf_init(&priv->notifier);
+ v4l2_async_subdev_nf_init(&priv->notifier, &priv->subdev);
priv->notifier.ops = &rcar_csi2_notify_ops;
asc = v4l2_async_nf_add_fwnode(&priv->notifier, fwnode,
priv->notifier.ops = &rcar_csi2_notify_ops;
asc = v4l2_async_nf_add_fwnode(&priv->notifier, fwnode,
if (IS_ERR(asc))
return PTR_ERR(asc);
if (IS_ERR(asc))
return PTR_ERR(asc);
- ret = v4l2_async_subdev_nf_register(&priv->subdev, &priv->notifier);
+ ret = v4l2_async_nf_register(&priv->notifier);
if (ret)
v4l2_async_nf_cleanup(&priv->notifier);
if (ret)
v4l2_async_nf_cleanup(&priv->notifier);
struct fwnode_handle *fwnode, *ep;
struct v4l2_async_connection *asd;
struct fwnode_handle *fwnode, *ep;
struct v4l2_async_connection *asd;
- v4l2_async_nf_init(notifier);
+ v4l2_async_nf_init(&sdr->notifier, &sdr->v4l2_dev);
ep = fwnode_graph_get_next_endpoint(of_fwnode_handle(sdr->dev->of_node),
NULL);
ep = fwnode_graph_get_next_endpoint(of_fwnode_handle(sdr->dev->of_node),
NULL);
sdr->notifier.ops = &rcar_drif_notify_ops;
/* Register notifier */
sdr->notifier.ops = &rcar_drif_notify_ops;
/* Register notifier */
- ret = v4l2_async_nf_register(&sdr->v4l2_dev, &sdr->notifier);
+ ret = v4l2_async_nf_register(&sdr->notifier);
if (ret < 0) {
dev_err(sdr->dev, "failed: notifier register ret %d\n", ret);
goto cleanup;
if (ret < 0) {
dev_err(sdr->dev, "failed: notifier register ret %d\n", ret);
goto cleanup;
if (ret)
goto error_pm_disable;
if (ret)
goto error_pm_disable;
- v4l2_async_nf_init(&ceudev->notifier);
+ v4l2_async_nf_init(&ceudev->notifier, &ceudev->v4l2_dev);
if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
ceu_data = of_device_get_match_data(dev);
if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
ceu_data = of_device_get_match_data(dev);
ceudev->notifier.v4l2_dev = &ceudev->v4l2_dev;
ceudev->notifier.ops = &ceu_notify_ops;
ceudev->notifier.v4l2_dev = &ceudev->v4l2_dev;
ceudev->notifier.ops = &ceu_notify_ops;
- ret = v4l2_async_nf_register(&ceudev->v4l2_dev, &ceudev->notifier);
+ ret = v4l2_async_nf_register(&ceudev->notifier);
if (ret)
goto error_cleanup;
if (ret)
goto error_cleanup;
- v4l2_async_nf_init(&cru->notifier);
+ v4l2_async_nf_init(&cru->notifier, &cru->v4l2_dev);
ret = rzg2l_cru_mc_parse_of(cru);
if (ret)
ret = rzg2l_cru_mc_parse_of(cru);
if (ret)
if (list_empty(&cru->notifier.waiting_list))
return 0;
if (list_empty(&cru->notifier.waiting_list))
return 0;
- ret = v4l2_async_nf_register(&cru->v4l2_dev, &cru->notifier);
+ ret = v4l2_async_nf_register(&cru->notifier);
if (ret < 0) {
dev_err(cru->dev, "Notifier registration failed\n");
v4l2_async_nf_cleanup(&cru->notifier);
if (ret < 0) {
dev_err(cru->dev, "Notifier registration failed\n");
v4l2_async_nf_cleanup(&cru->notifier);
fwnode = fwnode_graph_get_remote_endpoint(ep);
fwnode_handle_put(ep);
fwnode = fwnode_graph_get_remote_endpoint(ep);
fwnode_handle_put(ep);
- v4l2_async_nf_init(&csi2->notifier);
+ v4l2_async_subdev_nf_init(&csi2->notifier, &csi2->subdev);
csi2->notifier.ops = &rzg2l_csi2_notify_ops;
asd = v4l2_async_nf_add_fwnode(&csi2->notifier, fwnode,
csi2->notifier.ops = &rzg2l_csi2_notify_ops;
asd = v4l2_async_nf_add_fwnode(&csi2->notifier, fwnode,
if (IS_ERR(asd))
return PTR_ERR(asd);
if (IS_ERR(asd))
return PTR_ERR(asd);
- ret = v4l2_async_subdev_nf_register(&csi2->subdev, &csi2->notifier);
+ ret = v4l2_async_nf_register(&csi2->notifier);
if (ret)
v4l2_async_nf_cleanup(&csi2->notifier);
if (ret)
v4l2_async_nf_cleanup(&csi2->notifier);
unsigned int index = 0;
int ret = 0;
unsigned int index = 0;
int ret = 0;
- v4l2_async_nf_init(ntf);
+ v4l2_async_nf_init(ntf, &rkisp1->v4l2_dev);
ntf->ops = &rkisp1_subdev_notifier_ops;
ntf->ops = &rkisp1_subdev_notifier_ops;
if (!index)
dev_dbg(rkisp1->dev, "no remote subdevice found\n");
if (!index)
dev_dbg(rkisp1->dev, "no remote subdevice found\n");
- ret = v4l2_async_nf_register(&rkisp1->v4l2_dev, ntf);
+ ret = v4l2_async_nf_register(ntf);
if (ret) {
v4l2_async_nf_cleanup(ntf);
return ret;
if (ret) {
v4l2_async_nf_cleanup(ntf);
return ret;
platform_set_drvdata(pdev, fmd);
platform_set_drvdata(pdev, fmd);
- v4l2_async_nf_init(&fmd->subdev_notifier);
+ v4l2_async_nf_init(&fmd->subdev_notifier, &fmd->v4l2_dev);
ret = fimc_md_register_platform_entities(fmd, dev->of_node);
if (ret)
ret = fimc_md_register_platform_entities(fmd, dev->of_node);
if (ret)
fmd->subdev_notifier.ops = &subdev_notifier_ops;
fmd->num_sensors = 0;
fmd->subdev_notifier.ops = &subdev_notifier_ops;
fmd->num_sensors = 0;
- ret = v4l2_async_nf_register(&fmd->v4l2_dev,
- &fmd->subdev_notifier);
+ ret = v4l2_async_nf_register(&fmd->subdev_notifier);
if (ret)
goto err_clk_p;
}
if (ret)
goto err_clk_p;
}
- v4l2_async_nf_init(&dcmi->notifier);
+ v4l2_async_nf_init(&dcmi->notifier, &dcmi->v4l2_dev);
asd = v4l2_async_nf_add_fwnode_remote(&dcmi->notifier,
of_fwnode_handle(ep),
asd = v4l2_async_nf_add_fwnode_remote(&dcmi->notifier,
of_fwnode_handle(ep),
dcmi->notifier.ops = &dcmi_graph_notify_ops;
dcmi->notifier.ops = &dcmi_graph_notify_ops;
- ret = v4l2_async_nf_register(&dcmi->v4l2_dev, &dcmi->notifier);
+ ret = v4l2_async_nf_register(&dcmi->notifier);
if (ret < 0) {
dev_err(dcmi->dev, "Failed to register notifier\n");
v4l2_async_nf_cleanup(&dcmi->notifier);
if (ret < 0) {
dev_err(dcmi->dev, "Failed to register notifier\n");
v4l2_async_nf_cleanup(&dcmi->notifier);
struct fwnode_handle *ep;
int ret;
struct fwnode_handle *ep;
int ret;
- v4l2_async_nf_init(&csi->notifier);
+ v4l2_async_nf_init(&csi->notifier, &csi->v4l);
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(csi->dev), 0, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(csi->dev), 0, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
if (ret)
goto err_unregister_media;
if (ret)
goto err_unregister_media;
- ret = v4l2_async_nf_register(&csi->v4l, &csi->notifier);
+ ret = v4l2_async_nf_register(&csi->notifier);
if (ret) {
dev_err(csi->dev, "Couldn't register our notifier.\n");
goto err_unregister_media;
if (ret) {
dev_err(csi->dev, "Couldn't register our notifier.\n");
goto err_unregister_media;
- v4l2_async_nf_init(notifier);
+ if (csi_dev->isp_available)
+ v4l2_async_subdev_nf_init(notifier, subdev);
+ else
+ v4l2_async_nf_init(notifier, v4l2_dev);
notifier->ops = &sun6i_csi_bridge_notifier_ops;
sun6i_csi_bridge_source_setup(csi_dev, &bridge->source_parallel,
notifier->ops = &sun6i_csi_bridge_notifier_ops;
sun6i_csi_bridge_source_setup(csi_dev, &bridge->source_parallel,
sun6i_csi_bridge_source_setup(csi_dev, &bridge->source_mipi_csi2,
SUN6I_CSI_PORT_MIPI_CSI2, NULL);
sun6i_csi_bridge_source_setup(csi_dev, &bridge->source_mipi_csi2,
SUN6I_CSI_PORT_MIPI_CSI2, NULL);
- if (csi_dev->isp_available)
- ret = v4l2_async_subdev_nf_register(subdev, notifier);
- else
- ret = v4l2_async_nf_register(v4l2_dev, notifier);
+ ret = v4l2_async_nf_register(notifier);
if (ret) {
dev_err(dev, "failed to register v4l2 async notifier: %d\n",
ret);
if (ret) {
dev_err(dev, "failed to register v4l2 async notifier: %d\n",
ret);
- v4l2_async_nf_init(notifier);
+ v4l2_async_subdev_nf_init(notifier, subdev);
notifier->ops = &sun6i_mipi_csi2_notifier_ops;
ret = sun6i_mipi_csi2_bridge_source_setup(csi2_dev);
notifier->ops = &sun6i_mipi_csi2_notifier_ops;
ret = sun6i_mipi_csi2_bridge_source_setup(csi2_dev);
/* Only register the notifier when a sensor is connected. */
if (ret != -ENODEV) {
/* Only register the notifier when a sensor is connected. */
if (ret != -ENODEV) {
- ret = v4l2_async_subdev_nf_register(subdev, notifier);
+ ret = v4l2_async_nf_register(notifier);
if (ret < 0)
goto error_v4l2_notifier_cleanup;
if (ret < 0)
goto error_v4l2_notifier_cleanup;
- v4l2_async_nf_init(notifier);
+ v4l2_async_subdev_nf_init(notifier, subdev);
notifier->ops = &sun8i_a83t_mipi_csi2_notifier_ops;
ret = sun8i_a83t_mipi_csi2_bridge_source_setup(csi2_dev);
notifier->ops = &sun8i_a83t_mipi_csi2_notifier_ops;
ret = sun8i_a83t_mipi_csi2_bridge_source_setup(csi2_dev);
/* Only register the notifier when a sensor is connected. */
if (ret != -ENODEV) {
/* Only register the notifier when a sensor is connected. */
if (ret != -ENODEV) {
- ret = v4l2_async_subdev_nf_register(subdev, notifier);
+ ret = v4l2_async_nf_register(notifier);
if (ret < 0)
goto error_v4l2_notifier_cleanup;
if (ret < 0)
goto error_v4l2_notifier_cleanup;
dev_dbg(dev, "vpfe_get_pdata\n");
dev_dbg(dev, "vpfe_get_pdata\n");
- v4l2_async_nf_init(&vpfe->notifier);
+ v4l2_async_nf_init(&vpfe->notifier, &vpfe->v4l2_dev);
if (!IS_ENABLED(CONFIG_OF) || !dev->of_node)
return dev->platform_data;
if (!IS_ENABLED(CONFIG_OF) || !dev->of_node)
return dev->platform_data;
}
vpfe->notifier.ops = &vpfe_async_ops;
}
vpfe->notifier.ops = &vpfe_async_ops;
- ret = v4l2_async_nf_register(&vpfe->v4l2_dev, &vpfe->notifier);
+ ret = v4l2_async_nf_register(&vpfe->notifier);
if (ret) {
vpfe_err(vpfe, "Error registering async notifier\n");
ret = -EINVAL;
if (ret) {
vpfe_err(vpfe, "Error registering async notifier\n");
ret = -EINVAL;
- v4l2_async_nf_init(&cal->notifier);
+ v4l2_async_nf_init(&cal->notifier, &cal->v4l2_dev);
cal->notifier.ops = &cal_async_notifier_ops;
for (i = 0; i < cal->data->num_csi2_phy; ++i) {
cal->notifier.ops = &cal_async_notifier_ops;
for (i = 0; i < cal->data->num_csi2_phy; ++i) {
- ret = v4l2_async_nf_register(&cal->v4l2_dev, &cal->notifier);
+ ret = v4l2_async_nf_register(&cal->notifier);
if (ret) {
cal_err(cal, "Error registering async notifier\n");
goto error;
if (ret) {
cal_err(cal, "Error registering async notifier\n");
goto error;
};
static struct vpif_capture_config *
};
static struct vpif_capture_config *
-vpif_capture_get_pdata(struct platform_device *pdev)
+vpif_capture_get_pdata(struct platform_device *pdev,
+ struct v4l2_device *v4l2_dev)
{
struct device_node *endpoint = NULL;
struct device_node *rem = NULL;
{
struct device_node *endpoint = NULL;
struct device_node *rem = NULL;
struct vpif_capture_chan_config *chan;
unsigned int i;
struct vpif_capture_chan_config *chan;
unsigned int i;
- v4l2_async_nf_init(&vpif_obj.notifier);
+ v4l2_async_nf_init(&vpif_obj.notifier, v4l2_dev);
/*
* DT boot: OF node from parent device contains
/*
* DT boot: OF node from parent device contains
goto vpif_unregister;
} while (++res_idx);
goto vpif_unregister;
} while (++res_idx);
- pdev->dev.platform_data = vpif_capture_get_pdata(pdev);
+ pdev->dev.platform_data =
+ vpif_capture_get_pdata(pdev, &vpif_obj.v4l2_dev);
if (!pdev->dev.platform_data) {
dev_warn(&pdev->dev, "Missing platform data. Giving up.\n");
goto vpif_unregister;
if (!pdev->dev.platform_data) {
dev_warn(&pdev->dev, "Missing platform data. Giving up.\n");
goto vpif_unregister;
goto probe_subdev_out;
} else {
vpif_obj.notifier.ops = &vpif_async_ops;
goto probe_subdev_out;
} else {
vpif_obj.notifier.ops = &vpif_async_ops;
- err = v4l2_async_nf_register(&vpif_obj.v4l2_dev,
- &vpif_obj.notifier);
+ err = v4l2_async_nf_register(&vpif_obj.notifier);
if (err) {
vpif_err("Error registering async notifier\n");
err = -EINVAL;
if (err) {
vpif_err("Error registering async notifier\n");
err = -EINVAL;
isp->notifier.ops = &isp_subdev_notifier_ops;
isp->notifier.ops = &isp_subdev_notifier_ops;
- v4l2_async_nf_init(&isp->notifier);
+ v4l2_async_nf_init(&isp->notifier, &isp->v4l2_dev);
ret = isp_parse_of_endpoints(isp);
if (ret < 0)
goto error_register_entities;
ret = isp_parse_of_endpoints(isp);
if (ret < 0)
goto error_register_entities;
- ret = v4l2_async_nf_register(&isp->v4l2_dev, &isp->notifier);
+ ret = v4l2_async_nf_register(&isp->notifier);
if (ret)
goto error_register_entities;
if (ret)
goto error_register_entities;
- v4l2_async_nf_init(&vmux->notifier);
+ v4l2_async_subdev_nf_init(&vmux->notifier, &vmux->subdev);
for (i = 0; i < num_input_pads; i++) {
struct v4l2_async_connection *asd;
for (i = 0; i < num_input_pads; i++) {
struct v4l2_async_connection *asd;
vmux->notifier.ops = &video_mux_notify_ops;
vmux->notifier.ops = &video_mux_notify_ops;
- ret = v4l2_async_subdev_nf_register(&vmux->subdev, &vmux->notifier);
+ ret = v4l2_async_nf_register(&vmux->notifier);
if (ret)
goto err_nf_cleanup;
if (ret)
goto err_nf_cleanup;
- v4l2_async_nf_init(&xdev->notifier);
+ v4l2_async_nf_init(&xdev->notifier, &xdev->v4l2_dev);
/* Parse the graph to extract a list of subdevice DT nodes. */
ret = xvip_graph_parse(xdev);
/* Parse the graph to extract a list of subdevice DT nodes. */
ret = xvip_graph_parse(xdev);
/* Register the subdevices notifier. */
xdev->notifier.ops = &xvip_graph_notify_ops;
/* Register the subdevices notifier. */
xdev->notifier.ops = &xvip_graph_notify_ops;
- ret = v4l2_async_nf_register(&xdev->v4l2_dev, &xdev->notifier);
+ ret = v4l2_async_nf_register(&xdev->notifier);
if (ret < 0) {
dev_err(xdev->dev, "notifier registration failed\n");
goto done;
if (ret < 0) {
dev_err(xdev->dev, "notifier registration failed\n");
goto done;
-void v4l2_async_nf_init(struct v4l2_async_notifier *notifier)
+void v4l2_async_nf_init(struct v4l2_async_notifier *notifier,
+ struct v4l2_device *v4l2_dev)
{
INIT_LIST_HEAD(¬ifier->waiting_list);
INIT_LIST_HEAD(¬ifier->done_list);
{
INIT_LIST_HEAD(¬ifier->waiting_list);
INIT_LIST_HEAD(¬ifier->done_list);
+ notifier->v4l2_dev = v4l2_dev;
}
EXPORT_SYMBOL(v4l2_async_nf_init);
}
EXPORT_SYMBOL(v4l2_async_nf_init);
+void v4l2_async_subdev_nf_init(struct v4l2_async_notifier *notifier,
+ struct v4l2_subdev *sd)
+{
+ INIT_LIST_HEAD(¬ifier->waiting_list);
+ INIT_LIST_HEAD(¬ifier->done_list);
+ notifier->sd = sd;
+}
+EXPORT_SYMBOL_GPL(v4l2_async_subdev_nf_init);
+
static int __v4l2_async_nf_register(struct v4l2_async_notifier *notifier)
{
struct v4l2_async_connection *asc;
static int __v4l2_async_nf_register(struct v4l2_async_notifier *notifier)
{
struct v4l2_async_connection *asc;
-int v4l2_async_nf_register(struct v4l2_device *v4l2_dev,
- struct v4l2_async_notifier *notifier)
+int v4l2_async_nf_register(struct v4l2_async_notifier *notifier)
- if (WARN_ON(!v4l2_dev || notifier->sd))
+ if (WARN_ON(!notifier->v4l2_dev == !notifier->sd))
- notifier->v4l2_dev = v4l2_dev;
-
ret = __v4l2_async_nf_register(notifier);
if (ret)
notifier->v4l2_dev = NULL;
ret = __v4l2_async_nf_register(notifier);
if (ret)
notifier->v4l2_dev = NULL;
}
EXPORT_SYMBOL(v4l2_async_nf_register);
}
EXPORT_SYMBOL(v4l2_async_nf_register);
-int v4l2_async_subdev_nf_register(struct v4l2_subdev *sd,
- struct v4l2_async_notifier *notifier)
-{
- int ret;
-
- if (WARN_ON(!sd || notifier->v4l2_dev))
- return -EINVAL;
-
- notifier->sd = sd;
-
- ret = __v4l2_async_nf_register(notifier);
- if (ret)
- notifier->sd = NULL;
-
- return ret;
-}
-EXPORT_SYMBOL(v4l2_async_subdev_nf_register);
-
static void
__v4l2_async_nf_unregister(struct v4l2_async_notifier *notifier)
{
static void
__v4l2_async_nf_unregister(struct v4l2_async_notifier *notifier)
{
v4l2_async_nf_unbind_all_subdevs(notifier);
v4l2_async_nf_unbind_all_subdevs(notifier);
- notifier->sd = NULL;
- notifier->v4l2_dev = NULL;
-
list_del(¬ifier->notifier_entry);
}
list_del(¬ifier->notifier_entry);
}
+
+ notifier->sd = NULL;
+ notifier->v4l2_dev = NULL;
}
void v4l2_async_nf_cleanup(struct v4l2_async_notifier *notifier)
}
void v4l2_async_nf_cleanup(struct v4l2_async_notifier *notifier)
if (!notifier)
return -ENOMEM;
if (!notifier)
return -ENOMEM;
- v4l2_async_nf_init(notifier);
+ v4l2_async_subdev_nf_init(notifier, sd);
ret = v4l2_subdev_get_privacy_led(sd);
if (ret < 0)
ret = v4l2_subdev_get_privacy_led(sd);
if (ret < 0)
if (ret < 0)
goto out_cleanup;
if (ret < 0)
goto out_cleanup;
- ret = v4l2_async_subdev_nf_register(sd, notifier);
+ ret = v4l2_async_nf_register(notifier);
if (ret < 0)
goto out_cleanup;
if (ret < 0)
goto out_cleanup;
- v4l2_async_nf_init(&isp->notifier);
+ v4l2_async_nf_init(&isp->notifier, &isp->v4l2_dev);
isp->notifier.ops = &atomisp_async_ops;
for (i = 0; i < ATOMISP_CAMERA_NR_PORTS; i++) {
isp->notifier.ops = &atomisp_async_ops;
for (i = 0; i < ATOMISP_CAMERA_NR_PORTS; i++) {
isp->firmware = NULL;
isp->css_env.isp_css_fw.data = NULL;
isp->firmware = NULL;
isp->css_env.isp_css_fw.data = NULL;
- err = v4l2_async_nf_register(&isp->v4l2_dev, &isp->notifier);
+ err = v4l2_async_nf_register(&isp->notifier);
if (err) {
dev_err(isp->dev, "failed to register async notifier : %d\n", err);
goto css_init_fail;
if (err) {
dev_err(isp->dev, "failed to register async notifier : %d\n", err);
goto css_init_fail;
struct fwnode_handle *fwnode =
of_fwnode_handle(subdev_entity->epn);
struct fwnode_handle *fwnode =
of_fwnode_handle(subdev_entity->epn);
- v4l2_async_nf_init(&subdev_entity->notifier);
+ v4l2_async_nf_init(&subdev_entity->notifier, &isc->v4l2_dev);
asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
fwnode,
asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
fwnode,
subdev_entity->notifier.ops = &atmel_isc_async_ops;
subdev_entity->notifier.ops = &atmel_isc_async_ops;
- ret = v4l2_async_nf_register(&isc->v4l2_dev,
- &subdev_entity->notifier);
+ ret = v4l2_async_nf_register(&subdev_entity->notifier);
if (ret) {
dev_err(dev, "fail to register async notifier\n");
goto cleanup_subdev;
if (ret) {
dev_err(dev, "fail to register async notifier\n");
goto cleanup_subdev;
struct fwnode_handle *fwnode =
of_fwnode_handle(subdev_entity->epn);
struct fwnode_handle *fwnode =
of_fwnode_handle(subdev_entity->epn);
- v4l2_async_nf_init(&subdev_entity->notifier);
+ v4l2_async_nf_init(&subdev_entity->notifier, &isc->v4l2_dev);
asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
fwnode,
asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
fwnode,
subdev_entity->notifier.ops = &atmel_isc_async_ops;
subdev_entity->notifier.ops = &atmel_isc_async_ops;
- ret = v4l2_async_nf_register(&isc->v4l2_dev,
- &subdev_entity->notifier);
+ ret = v4l2_async_nf_register(&subdev_entity->notifier);
if (ret) {
dev_err(dev, "fail to register async notifier\n");
goto cleanup_subdev;
if (ret) {
dev_err(dev, "fail to register async notifier\n");
goto cleanup_subdev;
unsigned int port;
int ret;
unsigned int port;
int ret;
- v4l2_async_nf_init(&priv->notifier);
+ v4l2_async_subdev_nf_init(&priv->notifier, &priv->sd);
/* get this CSI's port id */
ret = fwnode_property_read_u32(dev_fwnode(priv->dev), "reg", &port);
/* get this CSI's port id */
ret = fwnode_property_read_u32(dev_fwnode(priv->dev), "reg", &port);
priv->notifier.ops = &csi_notify_ops;
priv->notifier.ops = &csi_notify_ops;
- ret = v4l2_async_subdev_nf_register(&priv->sd, &priv->notifier);
+ ret = v4l2_async_nf_register(&priv->notifier);
INIT_LIST_HEAD(&imxmd->vdev_list);
INIT_LIST_HEAD(&imxmd->vdev_list);
- v4l2_async_nf_init(&imxmd->notifier);
+ v4l2_async_nf_init(&imxmd->notifier, &imxmd->v4l2_dev);
/* prepare the async subdev notifier and register it */
imxmd->notifier.ops = ops ? ops : &imx_media_notifier_ops;
/* prepare the async subdev notifier and register it */
imxmd->notifier.ops = ops ? ops : &imx_media_notifier_ops;
- ret = v4l2_async_nf_register(&imxmd->v4l2_dev, &imxmd->notifier);
+ ret = v4l2_async_nf_register(&imxmd->notifier);
if (ret) {
v4l2_err(&imxmd->v4l2_dev,
"v4l2_async_nf_register failed with %d\n", ret);
if (ret) {
v4l2_err(&imxmd->v4l2_dev,
"v4l2_async_nf_register failed with %d\n", ret);
struct fwnode_handle *ep;
int ret;
struct fwnode_handle *ep;
int ret;
- v4l2_async_nf_init(&csi2->notifier);
+ v4l2_async_subdev_nf_init(&csi2->notifier, &csi2->sd);
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(csi2->dev), 0, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
ep = fwnode_graph_get_endpoint_by_id(dev_fwnode(csi2->dev), 0, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
csi2->notifier.ops = &csi2_notify_ops;
csi2->notifier.ops = &csi2_notify_ops;
- ret = v4l2_async_subdev_nf_register(&csi2->sd, &csi2->notifier);
+ ret = v4l2_async_nf_register(&csi2->notifier);
- v4l2_async_nf_init(notifier);
+ v4l2_async_nf_init(notifier, v4l2_dev);
notifier->ops = &sun6i_isp_proc_notifier_ops;
sun6i_isp_proc_source_setup(isp_dev, &proc->source_csi0,
notifier->ops = &sun6i_isp_proc_notifier_ops;
sun6i_isp_proc_source_setup(isp_dev, &proc->source_csi0,
sun6i_isp_proc_source_setup(isp_dev, &proc->source_csi1,
SUN6I_ISP_PORT_CSI1);
sun6i_isp_proc_source_setup(isp_dev, &proc->source_csi1,
SUN6I_ISP_PORT_CSI1);
- ret = v4l2_async_nf_register(v4l2_dev, notifier);
+ ret = v4l2_async_nf_register(notifier);
if (ret) {
v4l2_err(v4l2_dev,
"failed to register v4l2 async notifier: %d\n", ret);
if (ret) {
v4l2_err(v4l2_dev,
"failed to register v4l2 async notifier: %d\n", ret);
}
if (!IS_ENABLED(CONFIG_VIDEO_TEGRA_TPG))
}
if (!IS_ENABLED(CONFIG_VIDEO_TEGRA_TPG))
- v4l2_async_nf_init(&chan->notifier);
+ v4l2_async_nf_init(&chan->notifier, &vid->v4l2_dev);
static int tegra_vi_graph_init(struct tegra_vi *vi)
{
static int tegra_vi_graph_init(struct tegra_vi *vi)
{
- struct tegra_video_device *vid = dev_get_drvdata(vi->client.host);
struct tegra_vi_channel *chan;
struct fwnode_handle *fwnode = dev_fwnode(vi->dev);
int ret;
struct tegra_vi_channel *chan;
struct fwnode_handle *fwnode = dev_fwnode(vi->dev);
int ret;
continue;
chan->notifier.ops = &tegra_vi_async_ops;
continue;
chan->notifier.ops = &tegra_vi_async_ops;
- ret = v4l2_async_nf_register(&vid->v4l2_dev, &chan->notifier);
+ ret = v4l2_async_nf_register(&chan->notifier);
if (ret < 0) {
dev_err(vi->dev,
"failed to register channel %d notifier: %d\n",
if (ret < 0) {
dev_err(vi->dev,
"failed to register channel %d notifier: %d\n",
* v4l2_async_nf_init - Initialize a notifier.
*
* @notifier: pointer to &struct v4l2_async_notifier
* v4l2_async_nf_init - Initialize a notifier.
*
* @notifier: pointer to &struct v4l2_async_notifier
+ * @v4l2_dev: pointer to &struct v4l2_device
+ *
+ * This function initializes the notifier @asc_entry. It must be called
+ * before adding a subdevice to a notifier, using one of:
+ * v4l2_async_nf_add_fwnode_remote(),
+ * v4l2_async_nf_add_fwnode() or
+ * v4l2_async_nf_add_i2c().
+ */
+void v4l2_async_nf_init(struct v4l2_async_notifier *notifier,
+ struct v4l2_device *v4l2_dev);
+
+/**
+ * v4l2_async_subdev_nf_init - Initialize a sub-device notifier.
+ *
+ * @notifier: pointer to &struct v4l2_async_notifier
+ * @sd: pointer to &struct v4l2_subdev
*
* This function initializes the notifier @asc_list. It must be called
* before adding a subdevice to a notifier, using one of:
* v4l2_async_nf_add_fwnode_remote(), v4l2_async_nf_add_fwnode() or
* v4l2_async_nf_add_i2c().
*/
*
* This function initializes the notifier @asc_list. It must be called
* before adding a subdevice to a notifier, using one of:
* v4l2_async_nf_add_fwnode_remote(), v4l2_async_nf_add_fwnode() or
* v4l2_async_nf_add_i2c().
*/
-void v4l2_async_nf_init(struct v4l2_async_notifier *notifier);
+void v4l2_async_subdev_nf_init(struct v4l2_async_notifier *notifier,
+ struct v4l2_subdev *sd);
struct v4l2_async_connection *
__v4l2_async_nf_add_fwnode(struct v4l2_async_notifier *notifier,
struct v4l2_async_connection *
__v4l2_async_nf_add_fwnode(struct v4l2_async_notifier *notifier,
/**
* v4l2_async_nf_register - registers a subdevice asynchronous notifier
*
/**
* v4l2_async_nf_register - registers a subdevice asynchronous notifier
*
- * @v4l2_dev: pointer to &struct v4l2_device
- * @notifier: pointer to &struct v4l2_async_notifier
- */
-int v4l2_async_nf_register(struct v4l2_device *v4l2_dev,
- struct v4l2_async_notifier *notifier);
-
-/**
- * v4l2_async_subdev_nf_register - registers a subdevice asynchronous
- * notifier for a sub-device
- *
- * @sd: pointer to &struct v4l2_subdev
* @notifier: pointer to &struct v4l2_async_notifier
*/
* @notifier: pointer to &struct v4l2_async_notifier
*/
-int v4l2_async_subdev_nf_register(struct v4l2_subdev *sd,
- struct v4l2_async_notifier *notifier);
+int v4l2_async_nf_register(struct v4l2_async_notifier *notifier);
/**
* v4l2_async_nf_unregister - unregisters a subdevice
/**
* v4l2_async_nf_unregister - unregisters a subdevice