Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63b4ca23 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

[media] omap3isp: Move media_entity_cleanup() from unregister() to cleanup()



The media_entity_cleanup() function belong to the module cleanup
handlers, not the entity registration handlers. Move it there.

Create a omap3isp_video_cleanup() function to cleanup the video node
entity, and call it from the module cleanup handlers.

Rename omap3isp_stat_free() to omap3isp_stat_cleanup().

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 57f6217b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2206,8 +2206,6 @@ static int ccdc_init_entities(struct isp_ccdc_device *ccdc)

void omap3isp_ccdc_unregister_entities(struct isp_ccdc_device *ccdc)
{
	media_entity_cleanup(&ccdc->subdev.entity);

	v4l2_device_unregister_subdev(&ccdc->subdev);
	omap3isp_video_unregister(&ccdc->video_out);
}
@@ -2287,6 +2285,9 @@ void omap3isp_ccdc_cleanup(struct isp_device *isp)
{
	struct isp_ccdc_device *ccdc = &isp->isp_ccdc;

	omap3isp_video_cleanup(&ccdc->video_out);
	media_entity_cleanup(&ccdc->subdev.entity);

	/* Free LSC requests. As the CCDC is stopped there's no active request,
	 * so only the pending request and the free queue need to be handled.
	 */
+3 −2
Original line number Diff line number Diff line
@@ -1100,8 +1100,6 @@ static int ccp2_init_entities(struct isp_ccp2_device *ccp2)
 */
void omap3isp_ccp2_unregister_entities(struct isp_ccp2_device *ccp2)
{
	media_entity_cleanup(&ccp2->subdev.entity);

	v4l2_device_unregister_subdev(&ccp2->subdev);
	omap3isp_video_unregister(&ccp2->video_in);
}
@@ -1146,6 +1144,9 @@ void omap3isp_ccp2_cleanup(struct isp_device *isp)
{
	struct isp_ccp2_device *ccp2 = &isp->isp_ccp2;

	omap3isp_video_cleanup(&ccp2->video_in);
	media_entity_cleanup(&ccp2->subdev.entity);

	regulator_put(ccp2->vdds_csib);
}

+4 −2
Original line number Diff line number Diff line
@@ -1241,8 +1241,6 @@ static int csi2_init_entities(struct isp_csi2_device *csi2)

void omap3isp_csi2_unregister_entities(struct isp_csi2_device *csi2)
{
	media_entity_cleanup(&csi2->subdev.entity);

	v4l2_device_unregister_subdev(&csi2->subdev);
	omap3isp_video_unregister(&csi2->video_out);
}
@@ -1277,6 +1275,10 @@ error:
 */
void omap3isp_csi2_cleanup(struct isp_device *isp)
{
	struct isp_csi2_device *csi2a = &isp->isp_csi2a;

	omap3isp_video_cleanup(&csi2a->video_out);
	media_entity_cleanup(&csi2a->subdev.entity);
}

/*
+1 −1
Original line number Diff line number Diff line
@@ -370,5 +370,5 @@ void omap3isp_h3a_aewb_cleanup(struct isp_device *isp)
{
	kfree(isp->isp_aewb.priv);
	kfree(isp->isp_aewb.recover_priv);
	omap3isp_stat_free(&isp->isp_aewb);
	omap3isp_stat_cleanup(&isp->isp_aewb);
}
+1 −1
Original line number Diff line number Diff line
@@ -425,5 +425,5 @@ void omap3isp_h3a_af_cleanup(struct isp_device *isp)
{
	kfree(isp->isp_af.priv);
	kfree(isp->isp_af.recover_priv);
	omap3isp_stat_free(&isp->isp_af);
	omap3isp_stat_cleanup(&isp->isp_af);
}
Loading