]> git.baikalelectronics.ru Git - kernel.git/commit
[media] cx88: gracefully reject attempts to use unregistered cx88-blackbird driver
authorJonathan Nieder <jrnieder@gmail.com>
Sun, 1 May 2011 09:30:46 +0000 (06:30 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 20 May 2011 12:29:40 +0000 (09:29 -0300)
commitf3f9f1dd0de0543cc8803b0217d44692e733a582
tree8338da6519c62b3d40e486df85acf5eacce6c137
parentbd03236b696ff9265407cd66859cd9957a517caa
[media] cx88: gracefully reject attempts to use unregistered cx88-blackbird driver

It should not be possible to enter mpeg_open and acquire core->lock
without the blackbird driver being registered, so just error out if it
is not.  This makes the code more readable and should prevent the bug
fixed by the patch "hold device lock during sub-driver initialization"
from resurfacing again.

Similarly, if we enter mpeg_release and acquire core->lock then either
the blackbird driver is registered (since open files keep it loaded)
or the sysadmin forced the driver's removal.  In the latter case the
state will be inconsistent and this is worth a loud warning.

Tested-by: Andi Huber <hobrom@gmx.at>
Tested-by: Marlon de Boer <marlon@hyves.nl>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx88/cx88-blackbird.c