media: vimc: use new release op
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 5 Mar 2019 08:36:20 +0000 (03:36 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 19 Mar 2019 17:34:16 +0000 (13:34 -0400)
commit2b177f2849d23061508bb13594cc1bff1ccb46c9
treeaf17f637006d58cec9319e6ae442816d37124294
parent3650a23eda89f99b964fbd63a20320fafaa73e33
media: vimc: use new release op

Use the new v4l2_subdev_internal_ops release op to free the
subdev memory only when the last user closed the file handle.

Move v4l2_device_unregister_subdev() to the end of the
vimc_ent_sd_unregister() function since now the unregister_subdev()
call may free the vimc_ent_device struct which is used after the
unregister_subdev() call. So this now has to be done last.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vimc/vimc-common.c
drivers/media/platform/vimc/vimc-common.h
drivers/media/platform/vimc/vimc-debayer.c
drivers/media/platform/vimc/vimc-scaler.c
drivers/media/platform/vimc/vimc-sensor.c