diff options
Diffstat (limited to 'drivers/usb/media/se401.c')
-rw-r--r-- | drivers/usb/media/se401.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/media/se401.c b/drivers/usb/media/se401.c index 2ba562285fda..8c3b1ad8a8fd 100644 --- a/drivers/usb/media/se401.c +++ b/drivers/usb/media/se401.c | |||
@@ -1157,21 +1157,21 @@ static int se401_mmap(struct file *file, struct vm_area_struct *vma) | |||
1157 | unsigned long size = vma->vm_end-vma->vm_start; | 1157 | unsigned long size = vma->vm_end-vma->vm_start; |
1158 | unsigned long page, pos; | 1158 | unsigned long page, pos; |
1159 | 1159 | ||
1160 | down(&se401->lock); | 1160 | mutex_lock(&se401->lock); |
1161 | 1161 | ||
1162 | if (se401->dev == NULL) { | 1162 | if (se401->dev == NULL) { |
1163 | up(&se401->lock); | 1163 | mutex_unlock(&se401->lock); |
1164 | return -EIO; | 1164 | return -EIO; |
1165 | } | 1165 | } |
1166 | if (size > (((SE401_NUMFRAMES * se401->maxframesize) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))) { | 1166 | if (size > (((SE401_NUMFRAMES * se401->maxframesize) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))) { |
1167 | up(&se401->lock); | 1167 | mutex_unlock(&se401->lock); |
1168 | return -EINVAL; | 1168 | return -EINVAL; |
1169 | } | 1169 | } |
1170 | pos = (unsigned long)se401->fbuf; | 1170 | pos = (unsigned long)se401->fbuf; |
1171 | while (size > 0) { | 1171 | while (size > 0) { |
1172 | page = vmalloc_to_pfn((void *)pos); | 1172 | page = vmalloc_to_pfn((void *)pos); |
1173 | if (remap_pfn_range(vma, start, page, PAGE_SIZE, PAGE_SHARED)) { | 1173 | if (remap_pfn_range(vma, start, page, PAGE_SIZE, PAGE_SHARED)) { |
1174 | up(&se401->lock); | 1174 | mutex_unlock(&se401->lock); |
1175 | return -EAGAIN; | 1175 | return -EAGAIN; |
1176 | } | 1176 | } |
1177 | start += PAGE_SIZE; | 1177 | start += PAGE_SIZE; |
@@ -1181,7 +1181,7 @@ static int se401_mmap(struct file *file, struct vm_area_struct *vma) | |||
1181 | else | 1181 | else |
1182 | size = 0; | 1182 | size = 0; |
1183 | } | 1183 | } |
1184 | up(&se401->lock); | 1184 | mutex_unlock(&se401->lock); |
1185 | 1185 | ||
1186 | return 0; | 1186 | return 0; |
1187 | } | 1187 | } |
@@ -1366,7 +1366,7 @@ static int se401_probe(struct usb_interface *intf, | |||
1366 | memcpy(&se401->vdev, &se401_template, sizeof(se401_template)); | 1366 | memcpy(&se401->vdev, &se401_template, sizeof(se401_template)); |
1367 | memcpy(se401->vdev.name, se401->camera_name, strlen(se401->camera_name)); | 1367 | memcpy(se401->vdev.name, se401->camera_name, strlen(se401->camera_name)); |
1368 | init_waitqueue_head(&se401->wq); | 1368 | init_waitqueue_head(&se401->wq); |
1369 | init_MUTEX(&se401->lock); | 1369 | mutex_init(&se401->lock); |
1370 | wmb(); | 1370 | wmb(); |
1371 | 1371 | ||
1372 | if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { | 1372 | if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { |