summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vsp1/vsp1_entity.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-05-28 12:49:13 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-17 12:44:52 -0300
commit1499be67a545fb6f41acb5614b8e4732147cec50 (patch)
tree29bd2282d712ca560ed01dd6202f7e9b4caebf3c /drivers/media/platform/vsp1/vsp1_entity.c
parent7005a81705d032887b9f4f808e6dce8e57b8980a (diff)
downloadlinux-1499be67a545fb6f41acb5614b8e4732147cec50.tar.bz2
[media] v4l: vsp1: Cleanup video nodes at removal time
Video nodes created and initialized in the RPF and WPF init code paths are never unregistered, and the related resources (videobuf alloc context and media entity) never released. Fix this by storing a pointer to the vsp1_video object in vsp1_entity and calling vsp1_video_cleanup() from vsp1_entity_destroy(). This also allows simplifying the init error code paths. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_entity.c')
-rw-r--r--drivers/media/platform/vsp1/vsp1_entity.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_entity.c b/drivers/media/platform/vsp1/vsp1_entity.c
index 44167834285d..ceac0d7e5643 100644
--- a/drivers/media/platform/vsp1/vsp1_entity.c
+++ b/drivers/media/platform/vsp1/vsp1_entity.c
@@ -20,6 +20,7 @@
#include "vsp1.h"
#include "vsp1_entity.h"
+#include "vsp1_video.h"
/* -----------------------------------------------------------------------------
* V4L2 Subdevice Operations
@@ -185,6 +186,8 @@ int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
void vsp1_entity_destroy(struct vsp1_entity *entity)
{
+ if (entity->video)
+ vsp1_video_cleanup(entity->video);
if (entity->subdev.ctrl_handler)
v4l2_ctrl_handler_free(entity->subdev.ctrl_handler);
media_entity_cleanup(&entity->subdev.entity);