@@ -2002,6 +2002,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);
isp_unregister_entities(isp);
isp_cleanup_modules(isp);
isp_xclk_cleanup(isp);
@@ -2011,7 +2012,6 @@ static void isp_remove(struct platform_device *pdev)
__omap3isp_put(isp, false);
media_entity_enum_cleanup(&isp->crashed);
- v4l2_async_nf_cleanup(&isp->notifier);
kfree(isp);
}
@@ -2288,13 +2288,8 @@ static int isp_probe(struct platform_device *pdev)
mutex_init(&isp->isp_mutex);
spin_lock_init(&isp->stat_lock);
- v4l2_async_nf_init(&isp->notifier);
isp->dev = &pdev->dev;
- ret = isp_parse_of_endpoints(isp);
- if (ret < 0)
- goto error;
-
isp->ref_count = 0;
ret = dma_coerce_mask_and_coherent(isp->dev, DMA_BIT_MASK(32));
@@ -2426,6 +2421,12 @@ static int isp_probe(struct platform_device *pdev)
isp->notifier.ops = &isp_subdev_notifier_ops;
+ v4l2_async_nf_init(&isp->notifier);
+
+ ret = isp_parse_of_endpoints(isp);
+ if (ret < 0)
+ goto error_register_entities;
+
ret = v4l2_async_nf_register(&isp->v4l2_dev, &isp->notifier);
if (ret)
goto error_register_entities;
@@ -2436,6 +2437,7 @@ static int isp_probe(struct platform_device *pdev)
return 0;
error_register_entities:
+ v4l2_async_nf_cleanup(&isp->notifier);
isp_unregister_entities(isp);
error_modules:
isp_cleanup_modules(isp);
@@ -2445,7 +2447,6 @@ static int isp_probe(struct platform_device *pdev)
isp_xclk_cleanup(isp);
__omap3isp_put(isp, false);
error:
- v4l2_async_nf_cleanup(&isp->notifier);
mutex_destroy(&isp->isp_mutex);
error_release_isp:
kfree(isp);