aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zc0301
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/zc0301')
-rw-r--r--drivers/media/video/zc0301/zc0301.h6
-rw-r--r--drivers/media/video/zc0301/zc0301_core.c148
-rw-r--r--drivers/media/video/zc0301/zc0301_pas202bcb.c12
-rw-r--r--drivers/media/video/zc0301/zc0301_sensor.h4
4 files changed, 85 insertions, 85 deletions
diff --git a/drivers/media/video/zc0301/zc0301.h b/drivers/media/video/zc0301/zc0301.h
index 8e0655140e6..b9c93b8c16f 100644
--- a/drivers/media/video/zc0301/zc0301.h
+++ b/drivers/media/video/zc0301/zc0301.h
@@ -157,7 +157,7 @@ do { \
157 dev_info(&cam->usbdev->dev, fmt "\n", ## args); \ 157 dev_info(&cam->usbdev->dev, fmt "\n", ## args); \
158 else if ((level) >= 3) \ 158 else if ((level) >= 3) \
159 dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ 159 dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \
160 __FUNCTION__, __LINE__ , ## args); \ 160 __FUNCTION__, __LINE__ , ## args); \
161 } \ 161 } \
162} while (0) 162} while (0)
163# define KDBG(level, fmt, args...) \ 163# define KDBG(level, fmt, args...) \
@@ -167,7 +167,7 @@ do { \
167 pr_info("zc0301: " fmt "\n", ## args); \ 167 pr_info("zc0301: " fmt "\n", ## args); \
168 else if ((level) == 3) \ 168 else if ((level) == 3) \
169 pr_debug("zc0301: [%s:%d] " fmt "\n", __FUNCTION__, \ 169 pr_debug("zc0301: [%s:%d] " fmt "\n", __FUNCTION__, \
170 __LINE__ , ## args); \ 170 __LINE__ , ## args); \
171 } \ 171 } \
172} while (0) 172} while (0)
173# define V4LDBG(level, name, cmd) \ 173# define V4LDBG(level, name, cmd) \
@@ -184,7 +184,7 @@ do { \
184#undef PDBG 184#undef PDBG
185#define PDBG(fmt, args...) \ 185#define PDBG(fmt, args...) \
186dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ 186dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \
187 __FUNCTION__, __LINE__ , ## args) 187 __FUNCTION__, __LINE__ , ## args)
188 188
189#undef PDBGG 189#undef PDBGG
190#define PDBGG(fmt, args...) do {;} while(0) /* placeholder */ 190#define PDBGG(fmt, args...) do {;} while(0) /* placeholder */
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c
index 4036c6268bf..0fad39754f7 100644
--- a/drivers/media/video/zc0301/zc0301_core.c
+++ b/drivers/media/video/zc0301/zc0301_core.c
@@ -48,7 +48,7 @@
48/*****************************************************************************/ 48/*****************************************************************************/
49 49
50#define ZC0301_MODULE_NAME "V4L2 driver for ZC0301 " \ 50#define ZC0301_MODULE_NAME "V4L2 driver for ZC0301 " \
51 "Image Processor and Control Chip" 51 "Image Processor and Control Chip"
52#define ZC0301_MODULE_AUTHOR "(C) 2006 Luca Risolia" 52#define ZC0301_MODULE_AUTHOR "(C) 2006 Luca Risolia"
53#define ZC0301_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>" 53#define ZC0301_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>"
54#define ZC0301_MODULE_LICENSE "GPL" 54#define ZC0301_MODULE_LICENSE "GPL"
@@ -67,67 +67,67 @@ MODULE_LICENSE(ZC0301_MODULE_LICENSE);
67static short video_nr[] = {[0 ... ZC0301_MAX_DEVICES-1] = -1}; 67static short video_nr[] = {[0 ... ZC0301_MAX_DEVICES-1] = -1};
68module_param_array(video_nr, short, NULL, 0444); 68module_param_array(video_nr, short, NULL, 0444);
69MODULE_PARM_DESC(video_nr, 69MODULE_PARM_DESC(video_nr,
70 "\n<-1|n[,...]> Specify V4L2 minor mode number." 70 "\n<-1|n[,...]> Specify V4L2 minor mode number."
71 "\n -1 = use next available (default)" 71 "\n -1 = use next available (default)"
72 "\n n = use minor number n (integer >= 0)" 72 "\n n = use minor number n (integer >= 0)"
73 "\nYou can specify up to " 73 "\nYou can specify up to "
74 __MODULE_STRING(ZC0301_MAX_DEVICES) " cameras this way." 74 __MODULE_STRING(ZC0301_MAX_DEVICES) " cameras this way."
75 "\nFor example:" 75 "\nFor example:"
76 "\nvideo_nr=-1,2,-1 would assign minor number 2 to" 76 "\nvideo_nr=-1,2,-1 would assign minor number 2 to"
77 "\nthe second registered camera and use auto for the first" 77 "\nthe second registered camera and use auto for the first"
78 "\none and for every other camera." 78 "\none and for every other camera."
79 "\n"); 79 "\n");
80 80
81static short force_munmap[] = {[0 ... ZC0301_MAX_DEVICES-1] = 81static short force_munmap[] = {[0 ... ZC0301_MAX_DEVICES-1] =
82 ZC0301_FORCE_MUNMAP}; 82 ZC0301_FORCE_MUNMAP};
83module_param_array(force_munmap, bool, NULL, 0444); 83module_param_array(force_munmap, bool, NULL, 0444);
84MODULE_PARM_DESC(force_munmap, 84MODULE_PARM_DESC(force_munmap,
85 "\n<0|1[,...]> Force the application to unmap previously" 85 "\n<0|1[,...]> Force the application to unmap previously"
86 "\nmapped buffer memory before calling any VIDIOC_S_CROP or" 86 "\nmapped buffer memory before calling any VIDIOC_S_CROP or"
87 "\nVIDIOC_S_FMT ioctl's. Not all the applications support" 87 "\nVIDIOC_S_FMT ioctl's. Not all the applications support"
88 "\nthis feature. This parameter is specific for each" 88 "\nthis feature. This parameter is specific for each"
89 "\ndetected camera." 89 "\ndetected camera."
90 "\n 0 = do not force memory unmapping" 90 "\n 0 = do not force memory unmapping"
91 "\n 1 = force memory unmapping (save memory)" 91 "\n 1 = force memory unmapping (save memory)"
92 "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"." 92 "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"."
93 "\n"); 93 "\n");
94 94
95static unsigned int frame_timeout[] = {[0 ... ZC0301_MAX_DEVICES-1] = 95static unsigned int frame_timeout[] = {[0 ... ZC0301_MAX_DEVICES-1] =
96 ZC0301_FRAME_TIMEOUT}; 96 ZC0301_FRAME_TIMEOUT};
97module_param_array(frame_timeout, uint, NULL, 0644); 97module_param_array(frame_timeout, uint, NULL, 0644);
98MODULE_PARM_DESC(frame_timeout, 98MODULE_PARM_DESC(frame_timeout,
99 "\n<n[,...]> Timeout for a video frame in seconds." 99 "\n<n[,...]> Timeout for a video frame in seconds."
100 "\nThis parameter is specific for each detected camera." 100 "\nThis parameter is specific for each detected camera."
101 "\nDefault value is "__MODULE_STRING(ZC0301_FRAME_TIMEOUT)"." 101 "\nDefault value is "__MODULE_STRING(ZC0301_FRAME_TIMEOUT)"."
102 "\n"); 102 "\n");
103 103
104#ifdef ZC0301_DEBUG 104#ifdef ZC0301_DEBUG
105static unsigned short debug = ZC0301_DEBUG_LEVEL; 105static unsigned short debug = ZC0301_DEBUG_LEVEL;
106module_param(debug, ushort, 0644); 106module_param(debug, ushort, 0644);
107MODULE_PARM_DESC(debug, 107MODULE_PARM_DESC(debug,
108 "\n<n> Debugging information level, from 0 to 3:" 108 "\n<n> Debugging information level, from 0 to 3:"
109 "\n0 = none (use carefully)" 109 "\n0 = none (use carefully)"
110 "\n1 = critical errors" 110 "\n1 = critical errors"
111 "\n2 = significant informations" 111 "\n2 = significant informations"
112 "\n3 = more verbose messages" 112 "\n3 = more verbose messages"
113 "\nLevel 3 is useful for testing only, when only " 113 "\nLevel 3 is useful for testing only, when only "
114 "one device is used." 114 "one device is used."
115 "\nDefault value is "__MODULE_STRING(ZC0301_DEBUG_LEVEL)"." 115 "\nDefault value is "__MODULE_STRING(ZC0301_DEBUG_LEVEL)"."
116 "\n"); 116 "\n");
117#endif 117#endif
118 118
119/*****************************************************************************/ 119/*****************************************************************************/
120 120
121static u32 121static u32
122zc0301_request_buffers(struct zc0301_device* cam, u32 count, 122zc0301_request_buffers(struct zc0301_device* cam, u32 count,
123 enum zc0301_io_method io) 123 enum zc0301_io_method io)
124{ 124{
125 struct v4l2_pix_format* p = &(cam->sensor.pix_format); 125 struct v4l2_pix_format* p = &(cam->sensor.pix_format);
126 struct v4l2_rect* r = &(cam->sensor.cropcap.bounds); 126 struct v4l2_rect* r = &(cam->sensor.cropcap.bounds);
127 const size_t imagesize = cam->module_param.force_munmap || 127 const size_t imagesize = cam->module_param.force_munmap ||
128 io == IO_READ ? 128 io == IO_READ ?
129 (p->width * p->height * p->priv) / 8 : 129 (p->width * p->height * p->priv) / 8 :
130 (r->width * r->height * p->priv) / 8; 130 (r->width * r->height * p->priv) / 8;
131 void* buff = NULL; 131 void* buff = NULL;
132 u32 i; 132 u32 i;
133 133
@@ -216,7 +216,7 @@ int zc0301_write_reg(struct zc0301_device* cam, u16 index, u16 value)
216 int res; 216 int res;
217 217
218 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0xa0, 0x40, 218 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0xa0, 0x40,
219 value, index, NULL, 0, ZC0301_CTRL_TIMEOUT); 219 value, index, NULL, 0, ZC0301_CTRL_TIMEOUT);
220 if (res < 0) { 220 if (res < 0) {
221 DBG(3, "Failed to write a register (index 0x%04X, " 221 DBG(3, "Failed to write a register (index 0x%04X, "
222 "value 0x%02X, error %d)",index, value, res); 222 "value 0x%02X, error %d)",index, value, res);
@@ -234,7 +234,7 @@ int zc0301_read_reg(struct zc0301_device* cam, u16 index)
234 int res; 234 int res;
235 235
236 res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0xa1, 0xc0, 236 res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0xa1, 0xc0,
237 0x0001, index, buff, 1, ZC0301_CTRL_TIMEOUT); 237 0x0001, index, buff, 1, ZC0301_CTRL_TIMEOUT);
238 if (res < 0) 238 if (res < 0)
239 DBG(3, "Failed to read a register (index 0x%04X, error %d)", 239 DBG(3, "Failed to read a register (index 0x%04X, error %d)",
240 index, res); 240 index, res);
@@ -337,11 +337,11 @@ static void zc0301_urb_complete(struct urb *urb, struct pt_regs* regs)
337 337
338 if (!(*f)) 338 if (!(*f))
339 (*f) = list_entry(cam->inqueue.next, struct zc0301_frame_t, 339 (*f) = list_entry(cam->inqueue.next, struct zc0301_frame_t,
340 frame); 340 frame);
341 341
342 imagesize = (cam->sensor.pix_format.width * 342 imagesize = (cam->sensor.pix_format.width *
343 cam->sensor.pix_format.height * 343 cam->sensor.pix_format.height *
344 cam->sensor.pix_format.priv) / 8; 344 cam->sensor.pix_format.priv) / 8;
345 345
346 for (i = 0; i < urb->number_of_packets; i++) { 346 for (i = 0; i < urb->number_of_packets; i++) {
347 unsigned int len, status; 347 unsigned int len, status;
@@ -395,8 +395,8 @@ end_of_frame:
395 list_move_tail(&(*f)->frame, &cam->outqueue); 395 list_move_tail(&(*f)->frame, &cam->outqueue);
396 if (!list_empty(&cam->inqueue)) 396 if (!list_empty(&cam->inqueue))
397 (*f) = list_entry(cam->inqueue.next, 397 (*f) = list_entry(cam->inqueue.next,
398 struct zc0301_frame_t, 398 struct zc0301_frame_t,
399 frame); 399 frame);
400 else 400 else
401 (*f) = NULL; 401 (*f) = NULL;
402 spin_unlock(&cam->queue_lock); 402 spin_unlock(&cam->queue_lock);
@@ -429,14 +429,14 @@ static int zc0301_start_transfer(struct zc0301_device* cam)
429 struct usb_device *udev = cam->usbdev; 429 struct usb_device *udev = cam->usbdev;
430 struct urb* urb; 430 struct urb* urb;
431 const unsigned int wMaxPacketSize[] = {0, 128, 192, 256, 384, 431 const unsigned int wMaxPacketSize[] = {0, 128, 192, 256, 384,
432 512, 768, 1023}; 432 512, 768, 1023};
433 const unsigned int psz = wMaxPacketSize[ZC0301_ALTERNATE_SETTING]; 433 const unsigned int psz = wMaxPacketSize[ZC0301_ALTERNATE_SETTING];
434 s8 i, j; 434 s8 i, j;
435 int err = 0; 435 int err = 0;
436 436
437 for (i = 0; i < ZC0301_URBS; i++) { 437 for (i = 0; i < ZC0301_URBS; i++) {
438 cam->transfer_buffer[i] = kzalloc(ZC0301_ISO_PACKETS * psz, 438 cam->transfer_buffer[i] = kzalloc(ZC0301_ISO_PACKETS * psz,
439 GFP_KERNEL); 439 GFP_KERNEL);
440 if (!cam->transfer_buffer[i]) { 440 if (!cam->transfer_buffer[i]) {
441 err = -ENOMEM; 441 err = -ENOMEM;
442 DBG(1, "Not enough memory"); 442 DBG(1, "Not enough memory");
@@ -528,9 +528,9 @@ static int zc0301_stream_interrupt(struct zc0301_device* cam)
528 528
529 cam->stream = STREAM_INTERRUPT; 529 cam->stream = STREAM_INTERRUPT;
530 timeout = wait_event_timeout(cam->wait_stream, 530 timeout = wait_event_timeout(cam->wait_stream,
531 (cam->stream == STREAM_OFF) || 531 (cam->stream == STREAM_OFF) ||
532 (cam->state & DEV_DISCONNECTED), 532 (cam->state & DEV_DISCONNECTED),
533 ZC0301_URB_TIMEOUT); 533 ZC0301_URB_TIMEOUT);
534 if (cam->state & DEV_DISCONNECTED) 534 if (cam->state & DEV_DISCONNECTED)
535 return -ENODEV; 535 return -ENODEV;
536 else if (cam->stream != STREAM_OFF) { 536 else if (cam->stream != STREAM_OFF) {
@@ -548,7 +548,7 @@ static int zc0301_stream_interrupt(struct zc0301_device* cam)
548 548
549static int 549static int
550zc0301_set_compression(struct zc0301_device* cam, 550zc0301_set_compression(struct zc0301_device* cam,
551 struct v4l2_jpegcompression* compression) 551 struct v4l2_jpegcompression* compression)
552{ 552{
553 int r, err = 0; 553 int r, err = 0;
554 554
@@ -670,8 +670,8 @@ static int zc0301_open(struct inode* inode, struct file* filp)
670 } 670 }
671 mutex_unlock(&cam->dev_mutex); 671 mutex_unlock(&cam->dev_mutex);
672 err = wait_event_interruptible_exclusive(cam->open, 672 err = wait_event_interruptible_exclusive(cam->open,
673 cam->state & DEV_DISCONNECTED 673 cam->state & DEV_DISCONNECTED
674 || !cam->users); 674 || !cam->users);
675 if (err) { 675 if (err) {
676 up_read(&zc0301_disconnect); 676 up_read(&zc0301_disconnect);
677 return err; 677 return err;
@@ -802,12 +802,12 @@ zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
802 return -EAGAIN; 802 return -EAGAIN;
803 } 803 }
804 timeout = wait_event_interruptible_timeout 804 timeout = wait_event_interruptible_timeout
805 ( cam->wait_frame, 805 ( cam->wait_frame,
806 (!list_empty(&cam->outqueue)) || 806 (!list_empty(&cam->outqueue)) ||
807 (cam->state & DEV_DISCONNECTED) || 807 (cam->state & DEV_DISCONNECTED) ||
808 (cam->state & DEV_MISCONFIGURED), 808 (cam->state & DEV_MISCONFIGURED),
809 cam->module_param.frame_timeout * 809 cam->module_param.frame_timeout *
810 1000 * msecs_to_jiffies(1) ); 810 1000 * msecs_to_jiffies(1) );
811 if (timeout < 0) { 811 if (timeout < 0) {
812 mutex_unlock(&cam->fileop_mutex); 812 mutex_unlock(&cam->fileop_mutex);
813 return timeout; 813 return timeout;
@@ -930,7 +930,7 @@ static int zc0301_mmap(struct file* filp, struct vm_area_struct *vma)
930{ 930{
931 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 931 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
932 unsigned long size = vma->vm_end - vma->vm_start, 932 unsigned long size = vma->vm_end - vma->vm_start,
933 start = vma->vm_start; 933 start = vma->vm_start;
934 void *pos; 934 void *pos;
935 u32 i; 935 u32 i;
936 936
@@ -998,13 +998,13 @@ zc0301_vidioc_querycap(struct zc0301_device* cam, void __user * arg)
998 .driver = "zc0301", 998 .driver = "zc0301",
999 .version = ZC0301_MODULE_VERSION_CODE, 999 .version = ZC0301_MODULE_VERSION_CODE,
1000 .capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | 1000 .capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
1001 V4L2_CAP_STREAMING, 1001 V4L2_CAP_STREAMING,
1002 }; 1002 };
1003 1003
1004 strlcpy(cap.card, cam->v4ldev->name, sizeof(cap.card)); 1004 strlcpy(cap.card, cam->v4ldev->name, sizeof(cap.card));
1005 if (usb_make_path(cam->usbdev, cap.bus_info, sizeof(cap.bus_info)) < 0) 1005 if (usb_make_path(cam->usbdev, cap.bus_info, sizeof(cap.bus_info)) < 0)
1006 strlcpy(cap.bus_info, cam->usbdev->dev.bus_id, 1006 strlcpy(cap.bus_info, cam->usbdev->dev.bus_id,
1007 sizeof(cap.bus_info)); 1007 sizeof(cap.bus_info));
1008 1008
1009 if (copy_to_user(arg, &cap, sizeof(cap))) 1009 if (copy_to_user(arg, &cap, sizeof(cap)))
1010 return -EFAULT; 1010 return -EFAULT;
@@ -1337,7 +1337,7 @@ zc0301_vidioc_g_fmt(struct zc0301_device* cam, void __user * arg)
1337 1337
1338static int 1338static int
1339zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd, 1339zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
1340 void __user * arg) 1340 void __user * arg)
1341{ 1341{
1342 struct zc0301_sensor* s = &cam->sensor; 1342 struct zc0301_sensor* s = &cam->sensor;
1343 struct v4l2_format format; 1343 struct v4l2_format format;
@@ -1600,7 +1600,7 @@ zc0301_vidioc_qbuf(struct zc0301_device* cam, void __user * arg)
1600 1600
1601static int 1601static int
1602zc0301_vidioc_dqbuf(struct zc0301_device* cam, struct file* filp, 1602zc0301_vidioc_dqbuf(struct zc0301_device* cam, struct file* filp,
1603 void __user * arg) 1603 void __user * arg)
1604{ 1604{
1605 struct v4l2_buffer b; 1605 struct v4l2_buffer b;
1606 struct zc0301_frame_t *f; 1606 struct zc0301_frame_t *f;
@@ -1619,12 +1619,12 @@ zc0301_vidioc_dqbuf(struct zc0301_device* cam, struct file* filp,
1619 if (filp->f_flags & O_NONBLOCK) 1619 if (filp->f_flags & O_NONBLOCK)
1620 return -EAGAIN; 1620 return -EAGAIN;
1621 timeout = wait_event_interruptible_timeout 1621 timeout = wait_event_interruptible_timeout
1622 ( cam->wait_frame, 1622 ( cam->wait_frame,
1623 (!list_empty(&cam->outqueue)) || 1623 (!list_empty(&cam->outqueue)) ||
1624 (cam->state & DEV_DISCONNECTED) || 1624 (cam->state & DEV_DISCONNECTED) ||
1625 (cam->state & DEV_MISCONFIGURED), 1625 (cam->state & DEV_MISCONFIGURED),
1626 cam->module_param.frame_timeout * 1626 cam->module_param.frame_timeout *
1627 1000 * msecs_to_jiffies(1) ); 1627 1000 * msecs_to_jiffies(1) );
1628 if (timeout < 0) 1628 if (timeout < 0)
1629 return timeout; 1629 return timeout;
1630 if (cam->state & DEV_DISCONNECTED) 1630 if (cam->state & DEV_DISCONNECTED)
@@ -1748,7 +1748,7 @@ zc0301_vidioc_s_parm(struct zc0301_device* cam, void __user * arg)
1748 1748
1749 1749
1750static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp, 1750static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
1751 unsigned int cmd, void __user * arg) 1751 unsigned int cmd, void __user * arg)
1752{ 1752{
1753 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 1753 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
1754 1754
@@ -1842,7 +1842,7 @@ static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
1842 1842
1843 1843
1844static int zc0301_ioctl(struct inode* inode, struct file* filp, 1844static int zc0301_ioctl(struct inode* inode, struct file* filp,
1845 unsigned int cmd, unsigned long arg) 1845 unsigned int cmd, unsigned long arg)
1846{ 1846{
1847 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 1847 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
1848 int err = 0; 1848 int err = 0;
@@ -1948,7 +1948,7 @@ zc0301_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
1948 mutex_lock(&cam->dev_mutex); 1948 mutex_lock(&cam->dev_mutex);
1949 1949
1950 err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER, 1950 err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER,
1951 video_nr[dev_nr]); 1951 video_nr[dev_nr]);
1952 if (err) { 1952 if (err) {
1953 DBG(1, "V4L2 device registration failed"); 1953 DBG(1, "V4L2 device registration failed");
1954 if (err == -ENFILE && video_nr[dev_nr] == -1) 1954 if (err == -ENFILE && video_nr[dev_nr] == -1)
diff --git a/drivers/media/video/zc0301/zc0301_pas202bcb.c b/drivers/media/video/zc0301/zc0301_pas202bcb.c
index 9d282a22c15..eaadf025204 100644
--- a/drivers/media/video/zc0301/zc0301_pas202bcb.c
+++ b/drivers/media/video/zc0301/zc0301_pas202bcb.c
@@ -24,10 +24,10 @@
24 24
25/* 25/*
26 NOTE: Sensor controls are disabled for now, becouse changing them while 26 NOTE: Sensor controls are disabled for now, becouse changing them while
27 streaming sometimes results in out-of-sync video frames. We'll use 27 streaming sometimes results in out-of-sync video frames. We'll use
28 the default initialization, until we know how to stop and start video 28 the default initialization, until we know how to stop and start video
29 in the chip. However, the image quality still looks good under various 29 in the chip. However, the image quality still looks good under various
30 light conditions. 30 light conditions.
31*/ 31*/
32 32
33#include <linux/delay.h> 33#include <linux/delay.h>
@@ -165,7 +165,7 @@ static int pas202bcb_init(struct zc0301_device* cam)
165 165
166 166
167static int pas202bcb_get_ctrl(struct zc0301_device* cam, 167static int pas202bcb_get_ctrl(struct zc0301_device* cam,
168 struct v4l2_control* ctrl) 168 struct v4l2_control* ctrl)
169{ 169{
170 switch (ctrl->id) { 170 switch (ctrl->id) {
171 case V4L2_CID_EXPOSURE: 171 case V4L2_CID_EXPOSURE:
@@ -208,7 +208,7 @@ static int pas202bcb_get_ctrl(struct zc0301_device* cam,
208 208
209 209
210static int pas202bcb_set_ctrl(struct zc0301_device* cam, 210static int pas202bcb_set_ctrl(struct zc0301_device* cam,
211 const struct v4l2_control* ctrl) 211 const struct v4l2_control* ctrl)
212{ 212{
213 int err = 0; 213 int err = 0;
214 214
diff --git a/drivers/media/video/zc0301/zc0301_sensor.h b/drivers/media/video/zc0301/zc0301_sensor.h
index cf0965a81d0..1f95c28b101 100644
--- a/drivers/media/video/zc0301/zc0301_sensor.h
+++ b/drivers/media/video/zc0301/zc0301_sensor.h
@@ -51,7 +51,7 @@ zc0301_attach_sensor(struct zc0301_device* cam, struct zc0301_sensor* sensor);
51 51
52#define ZC0301_USB_DEVICE(vend, prod, intclass) \ 52#define ZC0301_USB_DEVICE(vend, prod, intclass) \
53 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ 53 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
54 USB_DEVICE_ID_MATCH_INT_CLASS, \ 54 USB_DEVICE_ID_MATCH_INT_CLASS, \
55 .idVendor = (vend), \ 55 .idVendor = (vend), \
56 .idProduct = (prod), \ 56 .idProduct = (prod), \
57 .bInterfaceClass = (intclass) 57 .bInterfaceClass = (intclass)
@@ -92,7 +92,7 @@ struct zc0301_sensor {
92 int (*init)(struct zc0301_device*); 92 int (*init)(struct zc0301_device*);
93 int (*get_ctrl)(struct zc0301_device*, struct v4l2_control* ctrl); 93 int (*get_ctrl)(struct zc0301_device*, struct v4l2_control* ctrl);
94 int (*set_ctrl)(struct zc0301_device*, 94 int (*set_ctrl)(struct zc0301_device*,
95 const struct v4l2_control* ctrl); 95 const struct v4l2_control* ctrl);
96 int (*set_crop)(struct zc0301_device*, const struct v4l2_rect* rect); 96 int (*set_crop)(struct zc0301_device*, const struct v4l2_rect* rect);
97 97
98 /* Private */ 98 /* Private */