aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vimc/vimc-common.h
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-05 03:36:20 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-03-19 13:34:16 -0400
commit2b177f2849d23061508bb13594cc1bff1ccb46c9 (patch)
treeaf17f637006d58cec9319e6ae442816d37124294 /drivers/media/platform/vimc/vimc-common.h
parent3650a23eda89f99b964fbd63a20320fafaa73e33 (diff)
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>
Diffstat (limited to 'drivers/media/platform/vimc/vimc-common.h')
-rw-r--r--drivers/media/platform/vimc/vimc-common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/vimc/vimc-common.h b/drivers/media/platform/vimc/vimc-common.h
index 84539430b5e7..c439cbf2f030 100644
--- a/drivers/media/platform/vimc/vimc-common.h
+++ b/drivers/media/platform/vimc/vimc-common.h
@@ -187,6 +187,7 @@ const struct vimc_pix_map *vimc_pix_map_by_pixelformat(u32 pixelformat);
187 * @function: media entity function defined by MEDIA_ENT_F_* macros 187 * @function: media entity function defined by MEDIA_ENT_F_* macros
188 * @num_pads: number of pads to initialize 188 * @num_pads: number of pads to initialize
189 * @pads_flag: flags to use in each pad 189 * @pads_flag: flags to use in each pad
190 * @sd_int_ops: pointer to &struct v4l2_subdev_internal_ops
190 * @sd_ops: pointer to &struct v4l2_subdev_ops. 191 * @sd_ops: pointer to &struct v4l2_subdev_ops.
191 * 192 *
192 * Helper function initialize and register the struct vimc_ent_device and struct 193 * Helper function initialize and register the struct vimc_ent_device and struct
@@ -199,6 +200,7 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved,
199 u32 function, 200 u32 function,
200 u16 num_pads, 201 u16 num_pads,
201 const unsigned long *pads_flag, 202 const unsigned long *pads_flag,
203 const struct v4l2_subdev_internal_ops *sd_int_ops,
202 const struct v4l2_subdev_ops *sd_ops); 204 const struct v4l2_subdev_ops *sd_ops);
203 205
204/** 206/**