]> git.baikalelectronics.ru Git - kernel.git/commit
[media] cx231xx: Fix unregister logic
authorMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 10 Jan 2012 11:20:01 +0000 (09:20 -0200)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 11 Jan 2012 00:35:29 +0000 (22:35 -0200)
commitb0f8a7c2c028cf2bf1b2b3f1dc0bbced3997c787
tree872fdcc3f4f8d7349befe6c2a10f079962438827
parentf48e430397bb8d631a2457a57952077fab6f1b76
[media] cx231xx: Fix unregister logic

There are several weirdness at the unregister logic.

First of all, IR has a poll thread. This thread needs to be
removed, as it uses some resources associated to the main driver.
So, the driver needs to explicitly unregister the I2C client for
ir-kbd-i2c.

If, for some reason, the driver needs to wait for a close()
to happen, not all memories will be freed, because the free
logic were in the wrong place.

Also, v4l2_device_unregister() seems to be called too early,
as devices are still using it.

Finally, even with the device disconnected, there is one
USB function call that will still try to talk with it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx231xx/cx231xx-cards.c
drivers/media/video/cx231xx/cx231xx-core.c
drivers/media/video/cx231xx/cx231xx-input.c
drivers/media/video/cx231xx/cx231xx.h
drivers/media/video/ir-kbd-i2c.c