]> git.baikalelectronics.ru Git - kernel.git/commit
[media] soc-camera: change order of removing device
authorLei Wen <leiwen@marvell.com>
Tue, 22 Nov 2011 14:04:29 +0000 (11:04 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 6 Jan 2012 13:00:55 +0000 (11:00 -0200)
commit602c8ae15dcedca5e5f97d57f328c27cd2cb5f25
treeb8d6f8dddc98c79d9cf3b50be3ad0e2a7144fc93
parent48be1211c41327d045ed5b4347fd03ef03ebe039
[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 <leiwen@marvell.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/soc_camera.c