/* If so far no errors then we shall start the camera */
if (!errCode) {
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
if (usbvision->power == 0) {
usbvision_power_on(usbvision);
usbvision_i2c_register(usbvision);
usbvision->initialized = 0;
}
}
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
}
if (errCode) {
(struct usb_usbvision *) video_get_drvdata(dev);
PDEBUG(DBG_IO, "close");
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
usbvision_audio_off(usbvision);
usbvision_restart_isoc(usbvision);
usbvision->initialized = 0;
}
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
if (usbvision->remove_pending) {
printk(KERN_INFO "%s: Final disconnect\n", __FUNCTION__);
if ((input >= usbvision->video_inputs) || (input < 0) )
return -EINVAL;
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
usbvision_muxsel(usbvision, input);
usbvision_set_input(usbvision);
usbvision_set_output(usbvision,
usbvision->curwidth,
usbvision->curheight);
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
return 0;
}
(struct usb_usbvision *) video_get_drvdata(dev);
usbvision->tvnormId=*id;
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
call_i2c_clients(usbvision, VIDIOC_S_STD,
&usbvision->tvnormId);
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
/* propagate the change to the decoder */
usbvision_muxsel(usbvision, usbvision->ctl_input);
usbvision->curFrame = NULL;
/* by now we are committed to the new data... */
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
usbvision_set_output(usbvision, vf->fmt.pix.width, vf->fmt.pix.height);
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
return 0;
}
PDEBUG(DBG_MMAP, "mmap");
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
if (!USBVISION_IS_OPERATIONAL(usbvision)) {
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
return -EFAULT;
}
if (!(vma->vm_flags & VM_WRITE) ||
size != PAGE_ALIGN(usbvision->max_frame_size)) {
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
return -EINVAL;
}
if (i == usbvision->num_frames) {
PDEBUG(DBG_MMAP,
"mmap: user supplied mapping address is out of range");
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
return -EINVAL;
}
if (vm_insert_page(vma, start, vmalloc_to_page(pos))) {
PDEBUG(DBG_MMAP, "mmap: vm_insert_page failed");
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
return -EAGAIN;
}
start += PAGE_SIZE;
size -= PAGE_SIZE;
}
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
return 0;
}
PDEBUG(DBG_IO, "%s:", __FUNCTION__);
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
if (usbvision->user) {
err("%s: Someone tried to open an already opened USBVision Radio!", __FUNCTION__);
usbvision->initialized = 0;
}
}
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
return errCode;
}
PDEBUG(DBG_IO, "");
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
/* Set packet size to 0 */
usbvision->ifaceAlt=0;
usbvision->initialized = 0;
}
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
if (usbvision->remove_pending) {
printk(KERN_INFO "%s: Final disconnect\n", __FUNCTION__);
usbvision->dev = dev;
- init_MUTEX(&usbvision->lock); /* to 1 == available */
+ mutex_init(&usbvision->lock); /* available */
// prepare control urb for control messages during interrupts
usbvision->ctrlUrb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
{
PDEBUG(DBG_PROBE, "");
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
usbvision_reset_powerOffTimer(usbvision);
usbvision->initialized = 0;
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
usbvision_remove_sysfs(usbvision->vdev);
usbvision_unregister_video(usbvision);
}
PDEBUG(DBG_PROBE, "bridgeType %d", usbvision->bridgeType);
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
/* compute alternate max packet sizes */
uif = dev->actconfig->interface[0];
usbvision->streaming = Stream_Off;
usbvision_register_video(usbvision);
usbvision_configure_video(usbvision);
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
usb_set_intfdata (intf, usbvision);
}
usb_set_intfdata (intf, NULL);
- down(&usbvision->lock);
+ mutex_lock(&usbvision->lock);
// At this time we ask to cancel outstanding URBs
usbvision_stop_isoc(usbvision);
usb_put_dev(usbvision->dev);
usbvision->dev = NULL; // USB device is no more
- up(&usbvision->lock);
+ mutex_unlock(&usbvision->lock);
if (usbvision->user) {
printk(KERN_INFO "%s: In use, disconnect pending\n",