提交 9fb82aaa 编写于 作者: D Dafna Hirschfeld 提交者: Mauro Carvalho Chehab

media: vimc: move media_entity_cleanup to release callbacks

according to the docs, this function must be called during
the cleanup phase after unregistering the entity.
Signed-off-by: NDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: NHelen Koike <helen.koike@collabora.com>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 291aca4e
...@@ -330,6 +330,7 @@ static void vimc_cap_release(struct video_device *vdev) ...@@ -330,6 +330,7 @@ static void vimc_cap_release(struct video_device *vdev)
struct vimc_cap_device *vcap = struct vimc_cap_device *vcap =
container_of(vdev, struct vimc_cap_device, vdev); container_of(vdev, struct vimc_cap_device, vdev);
media_entity_cleanup(vcap->ved.ent);
vimc_pads_cleanup(vcap->ved.pads); vimc_pads_cleanup(vcap->ved.pads);
kfree(vcap); kfree(vcap);
} }
...@@ -340,7 +341,6 @@ void vimc_cap_rm(struct vimc_device *vimc, struct vimc_ent_device *ved) ...@@ -340,7 +341,6 @@ void vimc_cap_rm(struct vimc_device *vimc, struct vimc_ent_device *ved)
vcap = container_of(ved, struct vimc_cap_device, ved); vcap = container_of(ved, struct vimc_cap_device, ved);
vb2_queue_release(&vcap->queue); vb2_queue_release(&vcap->queue);
media_entity_cleanup(ved->ent);
video_unregister_device(&vcap->vdev); video_unregister_device(&vcap->vdev);
} }
......
...@@ -423,7 +423,6 @@ EXPORT_SYMBOL_GPL(vimc_ent_sd_register); ...@@ -423,7 +423,6 @@ EXPORT_SYMBOL_GPL(vimc_ent_sd_register);
void vimc_ent_sd_unregister(struct vimc_ent_device *ved, struct v4l2_subdev *sd) void vimc_ent_sd_unregister(struct vimc_ent_device *ved, struct v4l2_subdev *sd)
{ {
media_entity_cleanup(ved->ent);
v4l2_device_unregister_subdev(sd); v4l2_device_unregister_subdev(sd);
} }
EXPORT_SYMBOL_GPL(vimc_ent_sd_unregister); EXPORT_SYMBOL_GPL(vimc_ent_sd_unregister);
...@@ -477,6 +477,7 @@ static void vimc_deb_release(struct v4l2_subdev *sd) ...@@ -477,6 +477,7 @@ static void vimc_deb_release(struct v4l2_subdev *sd)
struct vimc_deb_device *vdeb = struct vimc_deb_device *vdeb =
container_of(sd, struct vimc_deb_device, sd); container_of(sd, struct vimc_deb_device, sd);
media_entity_cleanup(vdeb->ved.ent);
vimc_pads_cleanup(vdeb->ved.pads); vimc_pads_cleanup(vdeb->ved.pads);
kfree(vdeb); kfree(vdeb);
} }
......
...@@ -336,6 +336,7 @@ static void vimc_sca_release(struct v4l2_subdev *sd) ...@@ -336,6 +336,7 @@ static void vimc_sca_release(struct v4l2_subdev *sd)
struct vimc_sca_device *vsca = struct vimc_sca_device *vsca =
container_of(sd, struct vimc_sca_device, sd); container_of(sd, struct vimc_sca_device, sd);
media_entity_cleanup(vsca->ved.ent);
vimc_pads_cleanup(vsca->ved.pads); vimc_pads_cleanup(vsca->ved.pads);
kfree(vsca); kfree(vsca);
} }
......
...@@ -291,6 +291,7 @@ static void vimc_sen_release(struct v4l2_subdev *sd) ...@@ -291,6 +291,7 @@ static void vimc_sen_release(struct v4l2_subdev *sd)
v4l2_ctrl_handler_free(&vsen->hdl); v4l2_ctrl_handler_free(&vsen->hdl);
tpg_free(&vsen->tpg); tpg_free(&vsen->tpg);
media_entity_cleanup(vsen->ved.ent);
vimc_pads_cleanup(vsen->ved.pads); vimc_pads_cleanup(vsen->ved.pads);
kfree(vsen); kfree(vsen);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册