aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/gspca.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r--drivers/media/video/gspca/gspca.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 5da4879f47f2..a3c2d36da0c8 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -21,6 +21,8 @@
21 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */ 22 */
23 23
24#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
25
24#define MODULE_NAME "gspca" 26#define MODULE_NAME "gspca"
25 27
26#include <linux/init.h> 28#include <linux/init.h>
@@ -148,7 +150,7 @@ static void int_irq(struct urb *urb)
148 if (ret == 0) { 150 if (ret == 0) {
149 ret = usb_submit_urb(urb, GFP_ATOMIC); 151 ret = usb_submit_urb(urb, GFP_ATOMIC);
150 if (ret < 0) 152 if (ret < 0)
151 err("Resubmit URB failed with error %i", ret); 153 pr_err("Resubmit URB failed with error %i\n", ret);
152 } 154 }
153} 155}
154 156
@@ -177,8 +179,8 @@ static int gspca_input_connect(struct gspca_dev *dev)
177 179
178 err = input_register_device(input_dev); 180 err = input_register_device(input_dev);
179 if (err) { 181 if (err) {
180 err("Input device registration failed with error %i", 182 pr_err("Input device registration failed with error %i\n",
181 err); 183 err);
182 input_dev->dev.parent = NULL; 184 input_dev->dev.parent = NULL;
183 input_free_device(input_dev); 185 input_free_device(input_dev);
184 } else { 186 } else {
@@ -323,8 +325,8 @@ static void fill_frame(struct gspca_dev *gspca_dev,
323 /* check the packet status and length */ 325 /* check the packet status and length */
324 st = urb->iso_frame_desc[i].status; 326 st = urb->iso_frame_desc[i].status;
325 if (st) { 327 if (st) {
326 err("ISOC data error: [%d] len=%d, status=%d", 328 pr_err("ISOC data error: [%d] len=%d, status=%d\n",
327 i, len, st); 329 i, len, st);
328 gspca_dev->last_packet_type = DISCARD_PACKET; 330 gspca_dev->last_packet_type = DISCARD_PACKET;
329 continue; 331 continue;
330 } 332 }
@@ -346,7 +348,7 @@ resubmit:
346 /* resubmit the URB */ 348 /* resubmit the URB */
347 st = usb_submit_urb(urb, GFP_ATOMIC); 349 st = usb_submit_urb(urb, GFP_ATOMIC);
348 if (st < 0) 350 if (st < 0)
349 err("usb_submit_urb() ret %d", st); 351 pr_err("usb_submit_urb() ret %d\n", st);
350} 352}
351 353
352/* 354/*
@@ -400,7 +402,7 @@ resubmit:
400 if (gspca_dev->cam.bulk_nurbs != 0) { 402 if (gspca_dev->cam.bulk_nurbs != 0) {
401 st = usb_submit_urb(urb, GFP_ATOMIC); 403 st = usb_submit_urb(urb, GFP_ATOMIC);
402 if (st < 0) 404 if (st < 0)
403 err("usb_submit_urb() ret %d", st); 405 pr_err("usb_submit_urb() ret %d\n", st);
404 } 406 }
405} 407}
406 408
@@ -464,7 +466,7 @@ void gspca_frame_add(struct gspca_dev *gspca_dev,
464 } else { 466 } else {
465/* !! image is NULL only when last pkt is LAST or DISCARD 467/* !! image is NULL only when last pkt is LAST or DISCARD
466 if (gspca_dev->image == NULL) { 468 if (gspca_dev->image == NULL) {
467 err("gspca_frame_add() image == NULL"); 469 pr_err("gspca_frame_add() image == NULL\n");
468 return; 470 return;
469 } 471 }
470 */ 472 */
@@ -525,7 +527,7 @@ static int frame_alloc(struct gspca_dev *gspca_dev, struct file *file,
525 count = GSPCA_MAX_FRAMES - 1; 527 count = GSPCA_MAX_FRAMES - 1;
526 gspca_dev->frbuf = vmalloc_32(frsz * count); 528 gspca_dev->frbuf = vmalloc_32(frsz * count);
527 if (!gspca_dev->frbuf) { 529 if (!gspca_dev->frbuf) {
528 err("frame alloc failed"); 530 pr_err("frame alloc failed\n");
529 return -ENOMEM; 531 return -ENOMEM;
530 } 532 }
531 gspca_dev->capt_file = file; 533 gspca_dev->capt_file = file;
@@ -597,7 +599,7 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev)
597 return 0; 599 return 0;
598 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0); 600 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0);
599 if (ret < 0) 601 if (ret < 0)
600 err("set alt 0 err %d", ret); 602 pr_err("set alt 0 err %d\n", ret);
601 return ret; 603 return ret;
602} 604}
603 605
@@ -673,7 +675,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
673 } 675 }
674 } 676 }
675 if (ep == NULL) { 677 if (ep == NULL) {
676 err("no transfer endpoint found"); 678 pr_err("no transfer endpoint found\n");
677 return NULL; 679 return NULL;
678 } 680 }
679 PDEBUG(D_STREAM, "use alt %d ep 0x%02x", 681 PDEBUG(D_STREAM, "use alt %d ep 0x%02x",
@@ -682,7 +684,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
682 if (gspca_dev->nbalt > 1) { 684 if (gspca_dev->nbalt > 1) {
683 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, i); 685 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, i);
684 if (ret < 0) { 686 if (ret < 0) {
685 err("set alt %d err %d", i, ret); 687 pr_err("set alt %d err %d\n", i, ret);
686 ep = NULL; 688 ep = NULL;
687 } 689 }
688 } 690 }
@@ -731,7 +733,7 @@ static int create_urbs(struct gspca_dev *gspca_dev,
731 for (n = 0; n < nurbs; n++) { 733 for (n = 0; n < nurbs; n++) {
732 urb = usb_alloc_urb(npkt, GFP_KERNEL); 734 urb = usb_alloc_urb(npkt, GFP_KERNEL);
733 if (!urb) { 735 if (!urb) {
734 err("usb_alloc_urb failed"); 736 pr_err("usb_alloc_urb failed\n");
735 return -ENOMEM; 737 return -ENOMEM;
736 } 738 }
737 gspca_dev->urb[n] = urb; 739 gspca_dev->urb[n] = urb;
@@ -741,7 +743,7 @@ static int create_urbs(struct gspca_dev *gspca_dev,
741 &urb->transfer_dma); 743 &urb->transfer_dma);
742 744
743 if (urb->transfer_buffer == NULL) { 745 if (urb->transfer_buffer == NULL) {
744 err("usb_alloc_coherent failed"); 746 pr_err("usb_alloc_coherent failed\n");
745 return -ENOMEM; 747 return -ENOMEM;
746 } 748 }
747 urb->dev = gspca_dev->dev; 749 urb->dev = gspca_dev->dev;
@@ -854,8 +856,8 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
854 break; 856 break;
855 gspca_stream_off(gspca_dev); 857 gspca_stream_off(gspca_dev);
856 if (ret != -ENOSPC) { 858 if (ret != -ENOSPC) {
857 err("usb_submit_urb alt %d err %d", 859 pr_err("usb_submit_urb alt %d err %d\n",
858 gspca_dev->alt, ret); 860 gspca_dev->alt, ret);
859 goto out; 861 goto out;
860 } 862 }
861 863
@@ -2202,12 +2204,12 @@ int gspca_dev_probe2(struct usb_interface *intf,
2202 dev_size = sizeof *gspca_dev; 2204 dev_size = sizeof *gspca_dev;
2203 gspca_dev = kzalloc(dev_size, GFP_KERNEL); 2205 gspca_dev = kzalloc(dev_size, GFP_KERNEL);
2204 if (!gspca_dev) { 2206 if (!gspca_dev) {
2205 err("couldn't kzalloc gspca struct"); 2207 pr_err("couldn't kzalloc gspca struct\n");
2206 return -ENOMEM; 2208 return -ENOMEM;
2207 } 2209 }
2208 gspca_dev->usb_buf = kmalloc(USB_BUF_SZ, GFP_KERNEL); 2210 gspca_dev->usb_buf = kmalloc(USB_BUF_SZ, GFP_KERNEL);
2209 if (!gspca_dev->usb_buf) { 2211 if (!gspca_dev->usb_buf) {
2210 err("out of memory"); 2212 pr_err("out of memory\n");
2211 ret = -ENOMEM; 2213 ret = -ENOMEM;
2212 goto out; 2214 goto out;
2213 } 2215 }
@@ -2264,7 +2266,7 @@ int gspca_dev_probe2(struct usb_interface *intf,
2264 VFL_TYPE_GRABBER, 2266 VFL_TYPE_GRABBER,
2265 -1); 2267 -1);
2266 if (ret < 0) { 2268 if (ret < 0) {
2267 err("video_register_device err %d", ret); 2269 pr_err("video_register_device err %d\n", ret);
2268 goto out; 2270 goto out;
2269 } 2271 }
2270 2272
@@ -2296,8 +2298,8 @@ int gspca_dev_probe(struct usb_interface *intf,
2296 2298
2297 /* we don't handle multi-config cameras */ 2299 /* we don't handle multi-config cameras */
2298 if (dev->descriptor.bNumConfigurations != 1) { 2300 if (dev->descriptor.bNumConfigurations != 1) {
2299 err("%04x:%04x too many config", 2301 pr_err("%04x:%04x too many config\n",
2300 id->idVendor, id->idProduct); 2302 id->idVendor, id->idProduct);
2301 return -ENODEV; 2303 return -ENODEV;
2302 } 2304 }
2303 2305
@@ -2480,7 +2482,7 @@ EXPORT_SYMBOL(gspca_auto_gain_n_exposure);
2480/* -- module insert / remove -- */ 2482/* -- module insert / remove -- */
2481static int __init gspca_init(void) 2483static int __init gspca_init(void)
2482{ 2484{
2483 info("v" DRIVER_VERSION_NUMBER " registered"); 2485 pr_info("v" DRIVER_VERSION_NUMBER " registered\n");
2484 return 0; 2486 return 0;
2485} 2487}
2486static void __exit gspca_exit(void) 2488static void __exit gspca_exit(void)