diff options
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-video.c')
-rw-r--r-- | drivers/media/video/cx231xx/cx231xx-video.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-video.c b/drivers/media/video/cx231xx/cx231xx-video.c index 6e81f970dc7d..829a41b0c9ef 100644 --- a/drivers/media/video/cx231xx/cx231xx-video.c +++ b/drivers/media/video/cx231xx/cx231xx-video.c | |||
@@ -337,7 +337,7 @@ static inline int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb) | |||
337 | if (!dev) | 337 | if (!dev) |
338 | return 0; | 338 | return 0; |
339 | 339 | ||
340 | if ((dev->state & DEV_DISCONNECTED) || (dev->state & DEV_MISCONFIGURED)) | 340 | if (dev->state & DEV_DISCONNECTED) |
341 | return 0; | 341 | return 0; |
342 | 342 | ||
343 | if (urb->status < 0) { | 343 | if (urb->status < 0) { |
@@ -440,7 +440,7 @@ static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb) | |||
440 | if (!dev) | 440 | if (!dev) |
441 | return 0; | 441 | return 0; |
442 | 442 | ||
443 | if ((dev->state & DEV_DISCONNECTED) || (dev->state & DEV_MISCONFIGURED)) | 443 | if (dev->state & DEV_DISCONNECTED) |
444 | return 0; | 444 | return 0; |
445 | 445 | ||
446 | if (urb->status < 0) { | 446 | if (urb->status < 0) { |
@@ -1000,12 +1000,6 @@ static int check_dev(struct cx231xx *dev) | |||
1000 | cx231xx_errdev("v4l2 ioctl: device not present\n"); | 1000 | cx231xx_errdev("v4l2 ioctl: device not present\n"); |
1001 | return -ENODEV; | 1001 | return -ENODEV; |
1002 | } | 1002 | } |
1003 | |||
1004 | if (dev->state & DEV_MISCONFIGURED) { | ||
1005 | cx231xx_errdev("v4l2 ioctl: device is misconfigured; " | ||
1006 | "close and open it again\n"); | ||
1007 | return -EIO; | ||
1008 | } | ||
1009 | return 0; | 1003 | return 0; |
1010 | } | 1004 | } |
1011 | 1005 | ||
@@ -2347,7 +2341,8 @@ static int cx231xx_v4l2_close(struct file *filp) | |||
2347 | return 0; | 2341 | return 0; |
2348 | } | 2342 | } |
2349 | 2343 | ||
2350 | if (dev->users == 1) { | 2344 | dev->users--; |
2345 | if (!dev->users) { | ||
2351 | videobuf_stop(&fh->vb_vidq); | 2346 | videobuf_stop(&fh->vb_vidq); |
2352 | videobuf_mmap_free(&fh->vb_vidq); | 2347 | videobuf_mmap_free(&fh->vb_vidq); |
2353 | 2348 | ||
@@ -2374,7 +2369,6 @@ static int cx231xx_v4l2_close(struct file *filp) | |||
2374 | cx231xx_set_alt_setting(dev, INDEX_VIDEO, 0); | 2369 | cx231xx_set_alt_setting(dev, INDEX_VIDEO, 0); |
2375 | } | 2370 | } |
2376 | kfree(fh); | 2371 | kfree(fh); |
2377 | dev->users--; | ||
2378 | wake_up_interruptible_nr(&dev->open, 1); | 2372 | wake_up_interruptible_nr(&dev->open, 1); |
2379 | return 0; | 2373 | return 0; |
2380 | } | 2374 | } |