[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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/video/omap3isp/ispstat.c b/drivers/media/video/omap3isp/ispstat.c
index 7329055..bf0e5a7 100644
--- a/drivers/media/video/omap3isp/ispstat.c
+++ b/drivers/media/video/omap3isp/ispstat.c
@@ -1062,7 +1062,6 @@
 
 void omap3isp_stat_unregister_entities(struct ispstat *stat)
 {
-	media_entity_cleanup(&stat->subdev.entity);
 	v4l2_device_unregister_subdev(&stat->subdev);
 }
 
@@ -1085,8 +1084,9 @@
 	return isp_stat_init_entities(stat, name, sd_ops);
 }
 
-void omap3isp_stat_free(struct ispstat *stat)
+void omap3isp_stat_cleanup(struct ispstat *stat)
 {
+	media_entity_cleanup(&stat->subdev.entity);
 	isp_stat_bufs_free(stat);
 	kfree(stat->buf);
 }