v4l: vsp1: Cleanup video nodes at removal time
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 28 May 2014 15:49:13 +0000 (12:49 -0300)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Wed, 4 Feb 2015 10:15:38 +0000 (11:15 +0100)
commitab0cde3d15dfe5f2fb190d900dca7edbfbbcbe7c
treec8b73185b47620c8723e2a1636d4430f1dd4eb19
parent786ce7bdfbf053b39586f9e4fd26bfd10f46633a
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>
(cherry picked from commit 1499be67a545fb6f41acb5614b8e4732147cec50)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/media/platform/vsp1/vsp1_entity.c
drivers/media/platform/vsp1/vsp1_entity.h
drivers/media/platform/vsp1/vsp1_rpf.c
drivers/media/platform/vsp1/vsp1_wpf.c