diff options
Diffstat (limited to 'drivers/media/video/usbvision/usbvision-video.c')
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index c2690df33438..db6b828594f5 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -357,7 +357,7 @@ static int usbvision_v4l2_open(struct file *file) | |||
357 | 357 | ||
358 | PDEBUG(DBG_IO, "open"); | 358 | PDEBUG(DBG_IO, "open"); |
359 | 359 | ||
360 | lock_kernel(); | 360 | mutex_lock(&usbvision->lock); |
361 | usbvision_reset_powerOffTimer(usbvision); | 361 | usbvision_reset_powerOffTimer(usbvision); |
362 | 362 | ||
363 | if (usbvision->user) | 363 | if (usbvision->user) |
@@ -379,7 +379,6 @@ static int usbvision_v4l2_open(struct file *file) | |||
379 | 379 | ||
380 | /* If so far no errors then we shall start the camera */ | 380 | /* If so far no errors then we shall start the camera */ |
381 | if (!errCode) { | 381 | if (!errCode) { |
382 | mutex_lock(&usbvision->lock); | ||
383 | if (usbvision->power == 0) { | 382 | if (usbvision->power == 0) { |
384 | usbvision_power_on(usbvision); | 383 | usbvision_power_on(usbvision); |
385 | usbvision_i2c_register(usbvision); | 384 | usbvision_i2c_register(usbvision); |
@@ -408,14 +407,13 @@ static int usbvision_v4l2_open(struct file *file) | |||
408 | usbvision->initialized = 0; | 407 | usbvision->initialized = 0; |
409 | } | 408 | } |
410 | } | 409 | } |
411 | mutex_unlock(&usbvision->lock); | ||
412 | } | 410 | } |
413 | 411 | ||
414 | /* prepare queues */ | 412 | /* prepare queues */ |
415 | usbvision_empty_framequeues(usbvision); | 413 | usbvision_empty_framequeues(usbvision); |
416 | 414 | ||
417 | PDEBUG(DBG_IO, "success"); | 415 | PDEBUG(DBG_IO, "success"); |
418 | unlock_kernel(); | 416 | mutex_unlock(&usbvision->lock); |
419 | return errCode; | 417 | return errCode; |
420 | } | 418 | } |
421 | 419 | ||
@@ -1645,8 +1643,8 @@ static int __devinit usbvision_probe(struct usb_interface *intf, | |||
1645 | usbvision->usb_bandwidth = 0; | 1643 | usbvision->usb_bandwidth = 0; |
1646 | usbvision->user = 0; | 1644 | usbvision->user = 0; |
1647 | usbvision->streaming = Stream_Off; | 1645 | usbvision->streaming = Stream_Off; |
1648 | usbvision_register_video(usbvision); | ||
1649 | usbvision_configure_video(usbvision); | 1646 | usbvision_configure_video(usbvision); |
1647 | usbvision_register_video(usbvision); | ||
1650 | mutex_unlock(&usbvision->lock); | 1648 | mutex_unlock(&usbvision->lock); |
1651 | 1649 | ||
1652 | usbvision_create_sysfs(usbvision->vdev); | 1650 | usbvision_create_sysfs(usbvision->vdev); |