summaryrefslogtreecommitdiff
path: root/drivers/media/video/cx231xx/cx231xx-cards.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-01-10 09:48:50 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-10 22:35:31 -0200
commit990862a2f024296f27460306393de8f0cdab8997 (patch)
treee8bc467d130a57dd03428010db57794b49f0b964 /drivers/media/video/cx231xx/cx231xx-cards.c
parentdb702a7af6c85d94ff32b6110b3646180f93f086 (diff)
downloadlwn-990862a2f024296f27460306393de8f0cdab8997.tar.gz
lwn-990862a2f024296f27460306393de8f0cdab8997.zip
[media] cx231xx: fix device disconnect checks
The driver were using DEV_MISCONFIGURED on some places, and DEV_DISCONNECTED on others. In a matter of fact, DEV_MISCONFIGURED were set only during the usb disconnect callback, with was confusing. Also, the alsa driver never checks if the device is present, before doing some dangerous things. Remove DEV_MISCONFIGURED, replacing it by DEV_DISCONNECTED. Also, fixes the other usecases for DEV_DISCONNECTED. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-cards.c')
-rw-r--r--drivers/media/video/cx231xx/cx231xx-cards.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index 1f2fbbfebc76..7577e6e50136 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -1337,6 +1337,8 @@ static void cx231xx_usb_disconnect(struct usb_interface *interface)
if (!dev->udev)
return;
+ dev->state |= DEV_DISCONNECTED;
+
flush_request_modules(dev);
/* wait until all current v4l2 io is finished then deallocate
@@ -1354,16 +1356,13 @@ static void cx231xx_usb_disconnect(struct usb_interface *interface)
/* Even having users, it is safe to remove the RC i2c driver */
cx231xx_ir_exit(dev);
- dev->state |= DEV_MISCONFIGURED;
if (dev->USE_ISO)
cx231xx_uninit_isoc(dev);
else
cx231xx_uninit_bulk(dev);
- dev->state |= DEV_DISCONNECTED;
wake_up_interruptible(&dev->wait_frame);
wake_up_interruptible(&dev->wait_stream);
} else {
- dev->state |= DEV_DISCONNECTED;
}
cx231xx_close_extension(dev);