From: Lei Wen Date: Tue, 22 Nov 2011 14:04:29 +0000 (-0300) Subject: [media] soc-camera: change order of removing device X-Git-Tag: accepted/tizen/common/20141203.182822~4667^2~193 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48ecf9fe8fbe7869dcbaeb636a8f9cfa937876aa;p=platform%2Fkernel%2Flinux-arm64.git [media] soc-camera: change order of removing device As our general practice, we use stream off before we close the video node. So that the drivers its stream off function would be called before its remove function. But for the case for ctrl+c, the program would be force closed. We have no chance to call that vb2 stream off from user space, but directly call the remove function in soc_camera. In that common code of soc_camera: ici->ops->remove(icd); if (ici->ops->init_videobuf2) vb2_queue_release(&icd->vb2_vidq); It would first call the device remove function, then release vb2, in which stream off function is called. Thus it create different order for the driver. This patch change the order to make driver see the same sequence to make it happy. Signed-off-by: Lei Wen Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index a14df27..b827107 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -600,9 +600,9 @@ static int soc_camera_close(struct file *file) pm_runtime_suspend(&icd->vdev->dev); pm_runtime_disable(&icd->vdev->dev); - ici->ops->remove(icd); if (ici->ops->init_videobuf2) vb2_queue_release(&icd->vb2_vidq); + ici->ops->remove(icd); soc_camera_power_off(icd, icl); }