@@ -595,12 +595,6 @@ static int ub913_v4l2_notifier_register(struct ub913_data *priv)
return 0;
}
-static void ub913_v4l2_nf_unregister(struct ub913_data *priv)
-{
- v4l2_async_nf_unregister(&priv->notifier);
- v4l2_async_nf_cleanup(&priv->notifier);
-}
-
static int ub913_register_clkout(struct ub913_data *priv)
{
struct device *dev = &priv->client->dev;
@@ -779,7 +773,7 @@ static int ub913_subdev_init(struct ub913_data *priv)
return 0;
err_unreg_notif:
- ub913_v4l2_nf_unregister(priv);
+ v4l2_async_nf_unregister_cleanup(&priv->notifier);
err_subdev_cleanup:
v4l2_subdev_cleanup(&priv->sd);
err_entity_cleanup:
@@ -791,7 +785,7 @@ static int ub913_subdev_init(struct ub913_data *priv)
static void ub913_subdev_uninit(struct ub913_data *priv)
{
v4l2_async_unregister_subdev(&priv->sd);
- ub913_v4l2_nf_unregister(priv);
+ v4l2_async_nf_unregister_cleanup(&priv->notifier);
v4l2_subdev_cleanup(&priv->sd);
fwnode_handle_put(priv->sd.fwnode);
media_entity_cleanup(&priv->sd.entity);
@@ -811,12 +811,6 @@ static int ub953_v4l2_notifier_register(struct ub953_data *priv)
return 0;
}
-static void ub953_v4l2_notifier_unregister(struct ub953_data *priv)
-{
- v4l2_async_nf_unregister(&priv->notifier);
- v4l2_async_nf_cleanup(&priv->notifier);
-}
-
/*
* Probing
*/
@@ -1277,7 +1271,7 @@ static int ub953_subdev_init(struct ub953_data *priv)
return 0;
err_unreg_notif:
- ub953_v4l2_notifier_unregister(priv);
+ v4l2_async_nf_unregister_cleanup(&priv->notifier);
err_free_state:
v4l2_subdev_cleanup(&priv->sd);
err_entity_cleanup:
@@ -1289,7 +1283,7 @@ static int ub953_subdev_init(struct ub953_data *priv)
static void ub953_subdev_uninit(struct ub953_data *priv)
{
v4l2_async_unregister_subdev(&priv->sd);
- ub953_v4l2_notifier_unregister(priv);
+ v4l2_async_nf_unregister_cleanup(&priv->notifier);
v4l2_subdev_cleanup(&priv->sd);
fwnode_handle_put(priv->sd.fwnode);
media_entity_cleanup(&priv->sd.entity);
@@ -3639,12 +3639,6 @@ static int ub960_v4l2_notifier_register(struct ub960_data *priv)
return 0;
}
-static void ub960_v4l2_notifier_unregister(struct ub960_data *priv)
-{
- v4l2_async_nf_unregister(&priv->notifier);
- v4l2_async_nf_cleanup(&priv->notifier);
-}
-
static int ub960_create_subdev(struct ub960_data *priv)
{
struct device *dev = &priv->client->dev;
@@ -3705,7 +3699,7 @@ static int ub960_create_subdev(struct ub960_data *priv)
return 0;
err_unreg_notif:
- ub960_v4l2_notifier_unregister(priv);
+ v4l2_async_nf_unregister_cleanup(&priv->notifier);
err_subdev_cleanup:
v4l2_subdev_cleanup(&priv->sd);
err_entity_cleanup:
@@ -3718,7 +3712,7 @@ static int ub960_create_subdev(struct ub960_data *priv)
static void ub960_destroy_subdev(struct ub960_data *priv)
{
- ub960_v4l2_notifier_unregister(priv);
+ v4l2_async_nf_unregister_cleanup(&priv->notifier);
v4l2_async_unregister_subdev(&priv->sd);
v4l2_subdev_cleanup(&priv->sd);
@@ -781,8 +781,7 @@ static void max9286_v4l2_notifier_unregister(struct max9286_priv *priv)
if (!priv->nsources)
return;
- v4l2_async_nf_unregister(&priv->notifier);
- v4l2_async_nf_cleanup(&priv->notifier);
+ v4l2_async_nf_unregister_cleanup(&priv->notifier);
}
static int max9286_s_stream(struct v4l2_subdev *sd, int enable)
@@ -909,8 +909,7 @@ static int mipid02_probe(struct i2c_client *client)
return 0;
unregister_notifier:
- v4l2_async_nf_unregister(&bridge->notifier);
- v4l2_async_nf_cleanup(&bridge->notifier);
+ v4l2_async_nf_unregister_cleanup(&bridge->notifier);
power_off:
mipid02_set_power_off(bridge);
entity_cleanup:
@@ -924,8 +923,7 @@ static void mipid02_remove(struct i2c_client *client)
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct mipid02_dev *bridge = to_mipid02_dev(sd);
- v4l2_async_nf_unregister(&bridge->notifier);
- v4l2_async_nf_cleanup(&bridge->notifier);
+ v4l2_async_nf_unregister_cleanup(&bridge->notifier);
v4l2_async_unregister_subdev(&bridge->sd);
mipid02_set_power_off(bridge);
media_entity_cleanup(&bridge->sd.entity);
@@ -1607,8 +1607,7 @@ static void tc358746_remove(struct i2c_client *client)
v4l2_subdev_cleanup(sd);
v4l2_ctrl_handler_free(&tc358746->ctrl_hdl);
v4l2_fwnode_endpoint_free(&tc358746->csi_vep);
- v4l2_async_nf_unregister(&tc358746->notifier);
- v4l2_async_nf_cleanup(&tc358746->notifier);
+ v4l2_async_nf_unregister_cleanup(&tc358746->notifier);
v4l2_async_unregister_subdev(sd);
media_entity_cleanup(&sd->entity);
@@ -1770,8 +1770,7 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,
return 0;
fail_clean_notifier:
- v4l2_async_nf_unregister(&cio2->notifier);
- v4l2_async_nf_cleanup(&cio2->notifier);
+ v4l2_async_nf_unregister_cleanup(&cio2->notifier);
cio2_queues_exit(cio2);
fail_v4l2_device_unregister:
v4l2_device_unregister(&cio2->v4l2_dev);
@@ -1790,8 +1789,7 @@ static void cio2_pci_remove(struct pci_dev *pci_dev)
struct cio2_device *cio2 = pci_get_drvdata(pci_dev);
media_device_unregister(&cio2->media_dev);
- v4l2_async_nf_unregister(&cio2->notifier);
- v4l2_async_nf_cleanup(&cio2->notifier);
+ v4l2_async_nf_unregister_cleanup(&cio2->notifier);
cio2_queues_exit(cio2);
cio2_fbpt_exit_dummy(cio2);
v4l2_device_unregister(&cio2->v4l2_dev);
@@ -767,12 +767,6 @@ static int isys_notifier_init(struct ipu6_isys *isys)
return ret;
}
-static void isys_notifier_cleanup(struct ipu6_isys *isys)
-{
- v4l2_async_nf_unregister(&isys->notifier);
- v4l2_async_nf_cleanup(&isys->notifier);
-}
-
static int isys_register_devices(struct ipu6_isys *isys)
{
struct device *dev = &isys->adev->auxdev.dev;
@@ -942,7 +936,7 @@ static void isys_remove(struct auxiliary_device *auxdev)
fwmsg, fwmsg->dma_addr, 0);
isys_unregister_devices(isys);
- isys_notifier_cleanup(isys);
+ v4l2_async_nf_unregister_cleanup(&isys->notifier);
cpu_latency_qos_remove_request(&isys->pm_qos);
@@ -752,8 +752,7 @@ static int mei_csi_probe(struct mei_cl_device *cldev,
err_ctrl_handler:
v4l2_ctrl_handler_free(&csi->ctrl_handler);
- v4l2_async_nf_unregister(&csi->notifier);
- v4l2_async_nf_cleanup(&csi->notifier);
+ v4l2_async_nf_unregister_cleanup(&csi->notifier);
err_disable:
mei_cldev_disable(cldev);
@@ -768,8 +767,7 @@ static void mei_csi_remove(struct mei_cl_device *cldev)
{
struct mei_csi *csi = mei_cldev_get_drvdata(cldev);
- v4l2_async_nf_unregister(&csi->notifier);
- v4l2_async_nf_cleanup(&csi->notifier);
+ v4l2_async_nf_unregister_cleanup(&csi->notifier);
v4l2_ctrl_handler_free(&csi->ctrl_handler);
v4l2_async_unregister_subdev(&csi->subdev);
v4l2_subdev_cleanup(&csi->subdev);
@@ -1327,8 +1327,7 @@ static void atmel_isi_remove(struct platform_device *pdev)
isi->p_fb_descriptors,
isi->fb_descriptors_phys);
pm_runtime_disable(&pdev->dev);
- v4l2_async_nf_unregister(&isi->notifier);
- v4l2_async_nf_cleanup(&isi->notifier);
+ v4l2_async_nf_unregister_cleanup(&isi->notifier);
v4l2_device_unregister(&isi->v4l2_dev);
}
@@ -722,8 +722,7 @@ static int csi2rx_probe(struct platform_device *pdev)
err_free_state:
v4l2_subdev_cleanup(&csi2rx->subdev);
err_cleanup:
- v4l2_async_nf_unregister(&csi2rx->notifier);
- v4l2_async_nf_cleanup(&csi2rx->notifier);
+ v4l2_async_nf_unregister_cleanup(&csi2rx->notifier);
media_entity_cleanup(&csi2rx->subdev.entity);
err_free_priv:
kfree(csi2rx);
@@ -734,8 +733,7 @@ static void csi2rx_remove(struct platform_device *pdev)
{
struct csi2rx_priv *csi2rx = platform_get_drvdata(pdev);
- v4l2_async_nf_unregister(&csi2rx->notifier);
- v4l2_async_nf_cleanup(&csi2rx->notifier);
+ v4l2_async_nf_unregister_cleanup(&csi2rx->notifier);
v4l2_async_unregister_subdev(&csi2rx->subdev);
v4l2_subdev_cleanup(&csi2rx->subdev);
media_entity_cleanup(&csi2rx->subdev.entity);
@@ -2433,8 +2433,7 @@ static void pxa_camera_remove(struct platform_device *pdev)
dma_release_channel(pcdev->dma_chans[1]);
dma_release_channel(pcdev->dma_chans[2]);
- v4l2_async_nf_unregister(&pcdev->notifier);
- v4l2_async_nf_cleanup(&pcdev->notifier);
+ v4l2_async_nf_unregister_cleanup(&pcdev->notifier);
v4l2_device_unregister(&pcdev->v4l2_dev);
@@ -1907,8 +1907,7 @@ int mccic_register(struct mcam_camera *cam)
return 0;
out:
- v4l2_async_nf_unregister(&cam->notifier);
- v4l2_async_nf_cleanup(&cam->notifier);
+ v4l2_async_nf_unregister_cleanup(&cam->notifier);
return ret;
}
EXPORT_SYMBOL_GPL(mccic_register);
@@ -1928,8 +1927,7 @@ void mccic_shutdown(struct mcam_camera *cam)
if (cam->buffer_mode == B_vmalloc)
mcam_free_dma_bufs(cam);
v4l2_ctrl_handler_free(&cam->ctrl_handler);
- v4l2_async_nf_unregister(&cam->notifier);
- v4l2_async_nf_cleanup(&cam->notifier);
+ v4l2_async_nf_unregister_cleanup(&cam->notifier);
}
EXPORT_SYMBOL_GPL(mccic_shutdown);
@@ -750,8 +750,7 @@ static void csi2dc_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
v4l2_async_unregister_subdev(&csi2dc->csi2dc_sd);
- v4l2_async_nf_unregister(&csi2dc->notifier);
- v4l2_async_nf_cleanup(&csi2dc->notifier);
+ v4l2_async_nf_unregister_cleanup(&csi2dc->notifier);
media_entity_cleanup(&csi2dc->csi2dc_sd.entity);
}
@@ -1856,10 +1856,8 @@ void microchip_isc_subdev_cleanup(struct isc_device *isc)
{
struct isc_subdev_entity *subdev_entity;
- list_for_each_entry(subdev_entity, &isc->subdev_entities, list) {
- v4l2_async_nf_unregister(&subdev_entity->notifier);
- v4l2_async_nf_cleanup(&subdev_entity->notifier);
- }
+ list_for_each_entry(subdev_entity, &isc->subdev_entities, list)
+ v4l2_async_nf_unregister_cleanup(&subdev_entity->notifier);
INIT_LIST_HEAD(&isc->subdev_entities);
}
@@ -1513,8 +1513,7 @@ static int mipi_csis_probe(struct platform_device *pdev)
err_cleanup:
v4l2_subdev_cleanup(&csis->sd);
media_entity_cleanup(&csis->sd.entity);
- v4l2_async_nf_unregister(&csis->notifier);
- v4l2_async_nf_cleanup(&csis->notifier);
+ v4l2_async_nf_unregister_cleanup(&csis->notifier);
v4l2_async_unregister_subdev(&csis->sd);
return ret;
@@ -1526,8 +1525,7 @@ static void mipi_csis_remove(struct platform_device *pdev)
struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd);
mipi_csis_debugfs_exit(csis);
- v4l2_async_nf_unregister(&csis->notifier);
- v4l2_async_nf_cleanup(&csis->notifier);
+ v4l2_async_nf_unregister_cleanup(&csis->notifier);
v4l2_async_unregister_subdev(&csis->sd);
if (!pm_runtime_enabled(&pdev->dev))
@@ -2266,8 +2266,7 @@ static void imx7_csi_remove(struct platform_device *pdev)
imx7_csi_media_cleanup(csi);
- v4l2_async_nf_unregister(&csi->notifier);
- v4l2_async_nf_cleanup(&csi->notifier);
+ v4l2_async_nf_unregister_cleanup(&csi->notifier);
v4l2_async_unregister_subdev(&csi->sd);
}
@@ -223,8 +223,7 @@ static void mxc_isi_v4l2_cleanup(struct mxc_isi_dev *isi)
{
unsigned int i;
- v4l2_async_nf_unregister(&isi->notifier);
- v4l2_async_nf_cleanup(&isi->notifier);
+ v4l2_async_nf_unregister_cleanup(&isi->notifier);
v4l2_device_unregister(&isi->v4l2_dev);
media_device_unregister(&isi->media_dev);
@@ -917,8 +917,7 @@ static int imx8mq_mipi_csi_probe(struct platform_device *pdev)
media_entity_cleanup(&state->sd.entity);
v4l2_subdev_cleanup(&state->sd);
- v4l2_async_nf_unregister(&state->notifier);
- v4l2_async_nf_cleanup(&state->notifier);
+ v4l2_async_nf_unregister_cleanup(&state->notifier);
v4l2_async_unregister_subdev(&state->sd);
icc:
imx8mq_mipi_csi_release_icc(pdev);
@@ -933,8 +932,7 @@ static void imx8mq_mipi_csi_remove(struct platform_device *pdev)
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct csi_state *state = mipi_sd_to_csi2_state(sd);
- v4l2_async_nf_unregister(&state->notifier);
- v4l2_async_nf_cleanup(&state->notifier);
+ v4l2_async_nf_unregister_cleanup(&state->notifier);
v4l2_async_unregister_subdev(&state->sd);
pm_runtime_disable(&pdev->dev);
@@ -2052,8 +2052,7 @@ static void camss_remove(struct platform_device *pdev)
{
struct camss *camss = platform_get_drvdata(pdev);
- v4l2_async_nf_unregister(&camss->notifier);
- v4l2_async_nf_cleanup(&camss->notifier);
+ v4l2_async_nf_unregister_cleanup(&camss->notifier);
camss_unregister_entities(camss);
if (atomic_read(&camss->ref_count) == 0)
@@ -1921,8 +1921,7 @@ static int rcsi2_probe(struct platform_device *pdev)
return 0;
error_async:
- v4l2_async_nf_unregister(&priv->notifier);
- v4l2_async_nf_cleanup(&priv->notifier);
+ v4l2_async_nf_unregister_cleanup(&priv->notifier);
error_mutex:
mutex_destroy(&priv->lock);
@@ -1933,8 +1932,7 @@ static void rcsi2_remove(struct platform_device *pdev)
{
struct rcar_csi2 *priv = platform_get_drvdata(pdev);
- v4l2_async_nf_unregister(&priv->notifier);
- v4l2_async_nf_cleanup(&priv->notifier);
+ v4l2_async_nf_unregister_cleanup(&priv->notifier);
v4l2_async_unregister_subdev(&priv->subdev);
pm_runtime_disable(&pdev->dev);
@@ -491,8 +491,7 @@ static int risp_probe(struct platform_device *pdev)
return 0;
error_notifier:
- v4l2_async_nf_unregister(&isp->notifier);
- v4l2_async_nf_cleanup(&isp->notifier);
+ v4l2_async_nf_unregister_cleanup(&isp->notifier);
error_pm:
pm_runtime_disable(&pdev->dev);
error_mutex:
@@ -505,8 +504,7 @@ static void risp_remove(struct platform_device *pdev)
{
struct rcar_isp *isp = platform_get_drvdata(pdev);
- v4l2_async_nf_unregister(&isp->notifier);
- v4l2_async_nf_cleanup(&isp->notifier);
+ v4l2_async_nf_unregister_cleanup(&isp->notifier);
v4l2_async_unregister_subdev(&isp->subdev);
@@ -345,10 +345,8 @@ static int rvin_group_parse_of(struct rvin_dev *vin, unsigned int port,
static void rvin_group_notifier_cleanup(struct rvin_dev *vin)
{
- if (&vin->v4l2_dev == vin->group->notifier.v4l2_dev) {
- v4l2_async_nf_unregister(&vin->group->notifier);
- v4l2_async_nf_cleanup(&vin->group->notifier);
- }
+ if (&vin->v4l2_dev == vin->group->notifier.v4l2_dev)
+ v4l2_async_nf_unregister_cleanup(&vin->group->notifier);
}
static int rvin_group_notifier_init(struct rvin_dev *vin, unsigned int port,
@@ -704,8 +702,7 @@ static int rvin_parallel_parse_of(struct rvin_dev *vin)
static void rvin_parallel_cleanup(struct rvin_dev *vin)
{
- v4l2_async_nf_unregister(&vin->notifier);
- v4l2_async_nf_cleanup(&vin->notifier);
+ v4l2_async_nf_unregister_cleanup(&vin->notifier);
}
static int rvin_parallel_init(struct rvin_dev *vin)
@@ -1361,8 +1361,7 @@ static int rcar_drif_sdr_probe(struct rcar_drif_sdr *sdr)
/* V4L2 SDR device remove */
static void rcar_drif_sdr_remove(struct rcar_drif_sdr *sdr)
{
- v4l2_async_nf_unregister(&sdr->notifier);
- v4l2_async_nf_cleanup(&sdr->notifier);
+ v4l2_async_nf_unregister_cleanup(&sdr->notifier);
v4l2_device_unregister(&sdr->v4l2_dev);
}
@@ -1701,9 +1701,7 @@ static void ceu_remove(struct platform_device *pdev)
pm_runtime_disable(ceudev->dev);
- v4l2_async_nf_unregister(&ceudev->notifier);
-
- v4l2_async_nf_cleanup(&ceudev->notifier);
+ v4l2_async_nf_unregister_cleanup(&ceudev->notifier);
v4l2_device_unregister(&ceudev->v4l2_dev);
@@ -303,8 +303,7 @@ static void rzg2l_cru_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
- v4l2_async_nf_unregister(&cru->notifier);
- v4l2_async_nf_cleanup(&cru->notifier);
+ v4l2_async_nf_unregister_cleanup(&cru->notifier);
rzg2l_cru_video_unregister(cru);
media_device_cleanup(&cru->mdev);
@@ -819,8 +819,7 @@ static int rzg2l_csi2_probe(struct platform_device *pdev)
error_subdev:
v4l2_subdev_cleanup(&csi2->subdev);
error_async:
- v4l2_async_nf_unregister(&csi2->notifier);
- v4l2_async_nf_cleanup(&csi2->notifier);
+ v4l2_async_nf_unregister_cleanup(&csi2->notifier);
media_entity_cleanup(&csi2->subdev.entity);
error_pm:
pm_runtime_disable(&pdev->dev);
@@ -832,8 +831,7 @@ static void rzg2l_csi2_remove(struct platform_device *pdev)
{
struct rzg2l_csi2 *csi2 = platform_get_drvdata(pdev);
- v4l2_async_nf_unregister(&csi2->notifier);
- v4l2_async_nf_cleanup(&csi2->notifier);
+ v4l2_async_nf_unregister_cleanup(&csi2->notifier);
v4l2_async_unregister_subdev(&csi2->subdev);
v4l2_subdev_cleanup(&csi2->subdev);
media_entity_cleanup(&csi2->subdev.entity);
@@ -720,8 +720,7 @@ static void rkisp1_remove(struct platform_device *pdev)
{
struct rkisp1_device *rkisp1 = platform_get_drvdata(pdev);
- v4l2_async_nf_unregister(&rkisp1->notifier);
- v4l2_async_nf_cleanup(&rkisp1->notifier);
+ v4l2_async_nf_unregister_cleanup(&rkisp1->notifier);
rkisp1_entities_unregister(rkisp1);
if (rkisp1_has_feature(rkisp1, MIPI_CSI2))
@@ -1538,8 +1538,7 @@ static void fimc_md_remove(struct platform_device *pdev)
return;
fimc_md_unregister_clk_provider(fmd);
- v4l2_async_nf_unregister(&fmd->subdev_notifier);
- v4l2_async_nf_cleanup(&fmd->subdev_notifier);
+ v4l2_async_nf_unregister_cleanup(&fmd->subdev_notifier);
v4l2_device_unregister(&fmd->v4l2_dev);
device_remove_file(&pdev->dev, &dev_attr_subdev_conf_mode);
@@ -2089,8 +2089,7 @@ static void dcmi_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
- v4l2_async_nf_unregister(&dcmi->notifier);
- v4l2_async_nf_cleanup(&dcmi->notifier);
+ v4l2_async_nf_unregister_cleanup(&dcmi->notifier);
media_entity_cleanup(&dcmi->vdev->entity);
v4l2_device_unregister(&dcmi->v4l2_dev);
media_device_cleanup(&dcmi->mdev);
@@ -524,8 +524,7 @@ static void dcmipp_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
- v4l2_async_nf_unregister(&dcmipp->notifier);
- v4l2_async_nf_cleanup(&dcmipp->notifier);
+ v4l2_async_nf_unregister_cleanup(&dcmipp->notifier);
for (i = 0; i < dcmipp->pipe_cfg->num_ents; i++)
dcmipp->pipe_cfg->ents[i].release(dcmipp->entity[i]);
@@ -265,8 +265,7 @@ static void sun4i_csi_remove(struct platform_device *pdev)
struct sun4i_csi *csi = platform_get_drvdata(pdev);
pm_runtime_disable(&pdev->dev);
- v4l2_async_nf_unregister(&csi->notifier);
- v4l2_async_nf_cleanup(&csi->notifier);
+ v4l2_async_nf_unregister_cleanup(&csi->notifier);
vb2_video_unregister_device(&csi->vdev);
media_device_unregister(&csi->mdev);
sun4i_csi_dma_unregister(csi);
@@ -863,8 +863,7 @@ void sun6i_csi_bridge_cleanup(struct sun6i_csi_device *csi_dev)
struct v4l2_subdev *subdev = &csi_dev->bridge.subdev;
struct v4l2_async_notifier *notifier = &csi_dev->bridge.notifier;
- v4l2_async_nf_unregister(notifier);
- v4l2_async_nf_cleanup(notifier);
+ v4l2_async_nf_unregister_cleanup(notifier);
v4l2_device_unregister_subdev(subdev);
@@ -577,8 +577,7 @@ sun6i_mipi_csi2_bridge_cleanup(struct sun6i_mipi_csi2_device *csi2_dev)
struct v4l2_async_notifier *notifier = &csi2_dev->bridge.notifier;
v4l2_async_unregister_subdev(subdev);
- v4l2_async_nf_unregister(notifier);
- v4l2_async_nf_cleanup(notifier);
+ v4l2_async_nf_unregister_cleanup(notifier);
media_entity_cleanup(&subdev->entity);
}
@@ -615,8 +615,7 @@ sun8i_a83t_mipi_csi2_bridge_cleanup(struct sun8i_a83t_mipi_csi2_device *csi2_dev
struct v4l2_async_notifier *notifier = &csi2_dev->bridge.notifier;
v4l2_async_unregister_subdev(subdev);
- v4l2_async_nf_unregister(notifier);
- v4l2_async_nf_cleanup(notifier);
+ v4l2_async_nf_unregister_cleanup(notifier);
media_entity_cleanup(&subdev->entity);
}
@@ -2485,8 +2485,7 @@ static void vpfe_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
- v4l2_async_nf_unregister(&vpfe->notifier);
- v4l2_async_nf_cleanup(&vpfe->notifier);
+ v4l2_async_nf_unregister_cleanup(&vpfe->notifier);
video_unregister_device(&vpfe->video_dev);
v4l2_device_unregister(&vpfe->v4l2_dev);
}
@@ -902,12 +902,6 @@ static int cal_async_notifier_register(struct cal_dev *cal)
return ret;
}
-static void cal_async_notifier_unregister(struct cal_dev *cal)
-{
- v4l2_async_nf_unregister(&cal->notifier);
- v4l2_async_nf_cleanup(&cal->notifier);
-}
-
/* ------------------------------------------------------------------
* Media and V4L2 device handling
* ------------------------------------------------------------------
@@ -952,7 +946,7 @@ static void cal_media_unregister(struct cal_dev *cal)
for (i = 0; i < cal->num_contexts; i++)
cal_ctx_v4l2_unregister(cal->ctx[i]);
- cal_async_notifier_unregister(cal);
+ v4l2_async_nf_unregister_cleanup(&cal->notifier);
media_device_unregister(&cal->mdev);
}
@@ -1720,8 +1720,7 @@ static void vpif_remove(struct platform_device *device)
struct channel_obj *ch;
int i;
- v4l2_async_nf_unregister(&vpif_obj.notifier);
- v4l2_async_nf_cleanup(&vpif_obj.notifier);
+ v4l2_async_nf_unregister_cleanup(&vpif_obj.notifier);
v4l2_device_unregister(&vpif_obj.v4l2_dev);
kfree(vpif_obj.sd);
@@ -1074,12 +1074,6 @@ static void ti_csi2rx_cleanup_v4l2(struct ti_csi2rx_dev *csi)
media_device_cleanup(&csi->mdev);
}
-static void ti_csi2rx_cleanup_subdev(struct ti_csi2rx_dev *csi)
-{
- v4l2_async_nf_unregister(&csi->notifier);
- v4l2_async_nf_cleanup(&csi->notifier);
-}
-
static void ti_csi2rx_cleanup_vb2q(struct ti_csi2rx_dev *csi)
{
vb2_queue_release(&csi->vidq);
@@ -1129,7 +1123,7 @@ static int ti_csi2rx_probe(struct platform_device *pdev)
return 0;
err_subdev:
- ti_csi2rx_cleanup_subdev(csi);
+ v4l2_async_nf_unregister_cleanup(&csi->notifier);
err_vb2q:
ti_csi2rx_cleanup_vb2q(csi);
err_v4l2:
@@ -1148,7 +1142,7 @@ static void ti_csi2rx_remove(struct platform_device *pdev)
video_unregister_device(&csi->vdev);
ti_csi2rx_cleanup_vb2q(csi);
- ti_csi2rx_cleanup_subdev(csi);
+ v4l2_async_nf_unregister_cleanup(&csi->notifier);
ti_csi2rx_cleanup_v4l2(csi);
ti_csi2rx_cleanup_dma(csi);
@@ -2001,8 +2001,7 @@ static void isp_remove(struct platform_device *pdev)
{
struct isp_device *isp = platform_get_drvdata(pdev);
- v4l2_async_nf_unregister(&isp->notifier);
- v4l2_async_nf_cleanup(&isp->notifier);
+ v4l2_async_nf_unregister_cleanup(&isp->notifier);
isp_unregister_entities(isp);
isp_cleanup_modules(isp);
isp_xclk_cleanup(isp);
@@ -471,8 +471,7 @@ static void video_mux_remove(struct platform_device *pdev)
struct video_mux *vmux = platform_get_drvdata(pdev);
struct v4l2_subdev *sd = &vmux->subdev;
- v4l2_async_nf_unregister(&vmux->notifier);
- v4l2_async_nf_cleanup(&vmux->notifier);
+ v4l2_async_nf_unregister_cleanup(&vmux->notifier);
v4l2_async_unregister_subdev(sd);
v4l2_subdev_cleanup(sd);
media_entity_cleanup(&sd->entity);
@@ -481,8 +481,7 @@ static void xvip_graph_cleanup(struct xvip_composite_device *xdev)
struct xvip_dma *dmap;
struct xvip_dma *dma;
- v4l2_async_nf_unregister(&xdev->notifier);
- v4l2_async_nf_cleanup(&xdev->notifier);
+ v4l2_async_nf_unregister_cleanup(&xdev->notifier);
list_for_each_entry_safe(dma, dmap, &xdev->dmas, list) {
xvip_dma_cleanup(dma);
@@ -1944,10 +1944,8 @@ void atmel_isc_subdev_cleanup(struct isc_device *isc)
{
struct isc_subdev_entity *subdev_entity;
- list_for_each_entry(subdev_entity, &isc->subdev_entities, list) {
- v4l2_async_nf_unregister(&subdev_entity->notifier);
- v4l2_async_nf_cleanup(&subdev_entity->notifier);
- }
+ list_for_each_entry(subdev_entity, &isc->subdev_entities, list)
+ v4l2_async_nf_unregister_cleanup(&subdev_entity->notifier);
INIT_LIST_HEAD(&isc->subdev_entities);
}
@@ -573,8 +573,7 @@ void sun6i_isp_proc_cleanup(struct sun6i_isp_device *isp_dev)
struct v4l2_async_notifier *notifier = &isp_dev->proc.notifier;
struct v4l2_subdev *subdev = &isp_dev->proc.subdev;
- v4l2_async_nf_unregister(notifier);
- v4l2_async_nf_cleanup(notifier);
+ v4l2_async_nf_unregister_cleanup(notifier);
v4l2_device_unregister_subdev(subdev);
media_entity_cleanup(&subdev->entity);
@@ -1802,8 +1802,7 @@ static void tegra_vi_graph_cleanup(struct tegra_vi *vi)
list_for_each_entry(chan, &vi->vi_chans, list) {
vb2_video_unregister_device(&chan->video);
- v4l2_async_nf_unregister(&chan->notifier);
- v4l2_async_nf_cleanup(&chan->notifier);
+ v4l2_async_nf_unregister_cleanup(&chan->notifier);
}
}
Now that we have a function to unregister and cleanup a notifier, use it! This patch has been generated using the following Coccinelle script: ---------8<------------ @@ expression E1; @@ - v4l2_async_nf_unregister(E1); - v4l2_async_nf_cleanup(E1); + v4l2_async_nf_unregister_cleanup(E1); ---------8<------------ Manually removed helper functions doing the same in various driver. Suggested-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Julien Massot <julien.massot@collabora.com> --- drivers/media/i2c/ds90ub913.c | 10 ++-------- drivers/media/i2c/ds90ub953.c | 10 ++-------- drivers/media/i2c/ds90ub960.c | 10 ++-------- drivers/media/i2c/max9286.c | 3 +-- drivers/media/i2c/st-mipid02.c | 6 ++---- drivers/media/i2c/tc358746.c | 3 +-- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 6 ++---- drivers/media/pci/intel/ipu6/ipu6-isys.c | 8 +------- drivers/media/pci/intel/ivsc/mei_csi.c | 6 ++---- drivers/media/platform/atmel/atmel-isi.c | 3 +-- drivers/media/platform/cadence/cdns-csi2rx.c | 6 ++---- drivers/media/platform/intel/pxa_camera.c | 3 +-- drivers/media/platform/marvell/mcam-core.c | 6 ++---- drivers/media/platform/microchip/microchip-csi2dc.c | 3 +-- drivers/media/platform/microchip/microchip-isc-base.c | 6 ++---- drivers/media/platform/nxp/imx-mipi-csis.c | 6 ++---- drivers/media/platform/nxp/imx7-media-csi.c | 3 +-- drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 3 +-- drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 6 ++---- drivers/media/platform/qcom/camss/camss.c | 3 +-- drivers/media/platform/renesas/rcar-csi2.c | 6 ++---- drivers/media/platform/renesas/rcar-isp.c | 6 ++---- drivers/media/platform/renesas/rcar-vin/rcar-core.c | 9 +++------ drivers/media/platform/renesas/rcar_drif.c | 3 +-- drivers/media/platform/renesas/renesas-ceu.c | 4 +--- drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c | 3 +-- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 6 ++---- drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 3 +-- drivers/media/platform/samsung/exynos4-is/media-dev.c | 3 +-- drivers/media/platform/st/stm32/stm32-dcmi.c | 3 +-- drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c | 3 +-- drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 3 +-- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c | 3 +-- drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 3 +-- .../platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c | 3 +-- drivers/media/platform/ti/am437x/am437x-vpfe.c | 3 +-- drivers/media/platform/ti/cal/cal.c | 8 +------- drivers/media/platform/ti/davinci/vpif_capture.c | 3 +-- drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 10 ++-------- drivers/media/platform/ti/omap3isp/isp.c | 3 +-- drivers/media/platform/video-mux.c | 3 +-- drivers/media/platform/xilinx/xilinx-vipp.c | 3 +-- drivers/staging/media/deprecated/atmel/atmel-isc-base.c | 6 ++---- drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c | 3 +-- drivers/staging/media/tegra-video/vi.c | 3 +-- 45 files changed, 63 insertions(+), 153 deletions(-)