Skip to content

Commit

Permalink
[media] soc-camera: change order of removing device
Browse files Browse the repository at this point in the history
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 <leiwen@marvell.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Lei Wen authored and Mauro Carvalho Chehab committed Jan 6, 2012
1 parent da673e6 commit 48ecf9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/soc_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 48ecf9f

Please sign in to comment.