aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/image
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/image')
-rw-r--r--drivers/usb/image/mdc800.c46
1 files changed, 30 insertions, 16 deletions
diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c
index dd432c8feaf8..878c77ca086e 100644
--- a/drivers/usb/image/mdc800.c
+++ b/drivers/usb/image/mdc800.c
@@ -355,7 +355,7 @@ static int mdc800_usb_waitForIRQ (int mode, int msec)
355 if (mdc800->camera_request_ready>0) 355 if (mdc800->camera_request_ready>0)
356 { 356 {
357 mdc800->camera_request_ready=0; 357 mdc800->camera_request_ready=0;
358 err ("timeout waiting for camera."); 358 dev_err(&mdc800->dev->dev, "timeout waiting for camera.\n");
359 return -1; 359 return -1;
360 } 360 }
361 361
@@ -380,7 +380,8 @@ static void mdc800_usb_write_notify (struct urb *urb)
380 int status = urb->status; 380 int status = urb->status;
381 381
382 if (status != 0) 382 if (status != 0)
383 err ("writing command fails (status=%i)", status); 383 dev_err(&mdc800->dev->dev,
384 "writing command fails (status=%i)\n", status);
384 else 385 else
385 mdc800->state=READY; 386 mdc800->state=READY;
386 mdc800->written = 1; 387 mdc800->written = 1;
@@ -407,7 +408,8 @@ static void mdc800_usb_download_notify (struct urb *urb)
407 mdc800->state=READY; 408 mdc800->state=READY;
408 } 409 }
409 } else { 410 } else {
410 err ("request bytes fails (status:%i)", status); 411 dev_err(&mdc800->dev->dev,
412 "request bytes fails (status:%i)\n", status);
411 } 413 }
412 mdc800->downloaded = 1; 414 mdc800->downloaded = 1;
413 wake_up (&mdc800->download_wait); 415 wake_up (&mdc800->download_wait);
@@ -450,7 +452,8 @@ static int mdc800_usb_probe (struct usb_interface *intf,
450 452
451 if (dev->descriptor.bNumConfigurations != 1) 453 if (dev->descriptor.bNumConfigurations != 1)
452 { 454 {
453 err ("probe fails -> wrong Number of Configuration"); 455 dev_err(&intf->dev,
456 "probe fails -> wrong Number of Configuration\n");
454 return -ENODEV; 457 return -ENODEV;
455 } 458 }
456 intf_desc = intf->cur_altsetting; 459 intf_desc = intf->cur_altsetting;
@@ -462,7 +465,7 @@ static int mdc800_usb_probe (struct usb_interface *intf,
462 || ( intf_desc->desc.bNumEndpoints != 4) 465 || ( intf_desc->desc.bNumEndpoints != 4)
463 ) 466 )
464 { 467 {
465 err ("probe fails -> wrong Interface"); 468 dev_err(&intf->dev, "probe fails -> wrong Interface\n");
466 return -ENODEV; 469 return -ENODEV;
467 } 470 }
468 471
@@ -483,7 +486,7 @@ static int mdc800_usb_probe (struct usb_interface *intf,
483 } 486 }
484 if (mdc800->endpoint[i] == -1) 487 if (mdc800->endpoint[i] == -1)
485 { 488 {
486 err ("probe fails -> Wrong Endpoints."); 489 dev_err(&intf->dev, "probe fails -> Wrong Endpoints.\n");
487 return -ENODEV; 490 return -ENODEV;
488 } 491 }
489 } 492 }
@@ -495,7 +498,7 @@ static int mdc800_usb_probe (struct usb_interface *intf,
495 498
496 retval = usb_register_dev(intf, &mdc800_class); 499 retval = usb_register_dev(intf, &mdc800_class);
497 if (retval) { 500 if (retval) {
498 err ("Not able to get a minor for this device."); 501 dev_err(&intf->dev, "Not able to get a minor for this device.\n");
499 return -ENODEV; 502 return -ENODEV;
500 } 503 }
501 504
@@ -645,7 +648,8 @@ static int mdc800_device_open (struct inode* inode, struct file *file)
645 mdc800->irq_urb->dev = mdc800->dev; 648 mdc800->irq_urb->dev = mdc800->dev;
646 retval = usb_submit_urb (mdc800->irq_urb, GFP_KERNEL); 649 retval = usb_submit_urb (mdc800->irq_urb, GFP_KERNEL);
647 if (retval) { 650 if (retval) {
648 err ("request USB irq fails (submit_retval=%i).", retval); 651 dev_err(&mdc800->dev->dev,
652 "request USB irq fails (submit_retval=%i).\n", retval);
649 errn = -EIO; 653 errn = -EIO;
650 goto error_out; 654 goto error_out;
651 } 655 }
@@ -735,7 +739,9 @@ static ssize_t mdc800_device_read (struct file *file, char __user *buf, size_t l
735 mdc800->download_urb->dev = mdc800->dev; 739 mdc800->download_urb->dev = mdc800->dev;
736 retval = usb_submit_urb (mdc800->download_urb, GFP_KERNEL); 740 retval = usb_submit_urb (mdc800->download_urb, GFP_KERNEL);
737 if (retval) { 741 if (retval) {
738 err ("Can't submit download urb (retval=%i)",retval); 742 dev_err(&mdc800->dev->dev,
743 "Can't submit download urb "
744 "(retval=%i)\n", retval);
739 mutex_unlock(&mdc800->io_lock); 745 mutex_unlock(&mdc800->io_lock);
740 return len-left; 746 return len-left;
741 } 747 }
@@ -744,7 +750,10 @@ static ssize_t mdc800_device_read (struct file *file, char __user *buf, size_t l
744 mdc800->downloaded = 0; 750 mdc800->downloaded = 0;
745 if (mdc800->download_urb->status != 0) 751 if (mdc800->download_urb->status != 0)
746 { 752 {
747 err ("request download-bytes fails (status=%i)",mdc800->download_urb->status); 753 dev_err(&mdc800->dev->dev,
754 "request download-bytes fails "
755 "(status=%i)\n",
756 mdc800->download_urb->status);
748 mutex_unlock(&mdc800->io_lock); 757 mutex_unlock(&mdc800->io_lock);
749 return len-left; 758 return len-left;
750 } 759 }
@@ -841,7 +850,8 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
841 850
842 if (mdc800_usb_waitForIRQ (0,TO_GET_READY)) 851 if (mdc800_usb_waitForIRQ (0,TO_GET_READY))
843 { 852 {
844 err ("Camera didn't get ready.\n"); 853 dev_err(&mdc800->dev->dev,
854 "Camera didn't get ready.\n");
845 mutex_unlock(&mdc800->io_lock); 855 mutex_unlock(&mdc800->io_lock);
846 return -EIO; 856 return -EIO;
847 } 857 }
@@ -853,7 +863,9 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
853 mdc800->write_urb->dev = mdc800->dev; 863 mdc800->write_urb->dev = mdc800->dev;
854 retval = usb_submit_urb (mdc800->write_urb, GFP_KERNEL); 864 retval = usb_submit_urb (mdc800->write_urb, GFP_KERNEL);
855 if (retval) { 865 if (retval) {
856 err ("submitting write urb fails (retval=%i)", retval); 866 dev_err(&mdc800->dev->dev,
867 "submitting write urb fails "
868 "(retval=%i)\n", retval);
857 mutex_unlock(&mdc800->io_lock); 869 mutex_unlock(&mdc800->io_lock);
858 return -EIO; 870 return -EIO;
859 } 871 }
@@ -872,7 +884,9 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
872 case 0x3e: /* Take shot in Fine Mode (WCam Mode) */ 884 case 0x3e: /* Take shot in Fine Mode (WCam Mode) */
873 if (mdc800->pic_len < 0) 885 if (mdc800->pic_len < 0)
874 { 886 {
875 err ("call 0x07 before 0x05,0x3e"); 887 dev_err(&mdc800->dev->dev,
888 "call 0x07 before "
889 "0x05,0x3e\n");
876 mdc800->state=READY; 890 mdc800->state=READY;
877 mutex_unlock(&mdc800->io_lock); 891 mutex_unlock(&mdc800->io_lock);
878 return -EIO; 892 return -EIO;
@@ -892,7 +906,7 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
892 906
893 if (mdc800_usb_waitForIRQ (1,TO_READ_FROM_IRQ)) 907 if (mdc800_usb_waitForIRQ (1,TO_READ_FROM_IRQ))
894 { 908 {
895 err ("requesting answer from irq fails"); 909 dev_err(&mdc800->dev->dev, "requesting answer from irq fails\n");
896 mutex_unlock(&mdc800->io_lock); 910 mutex_unlock(&mdc800->io_lock);
897 return -EIO; 911 return -EIO;
898 } 912 }
@@ -920,7 +934,7 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s
920 { 934 {
921 if (mdc800_usb_waitForIRQ (0,TO_DEFAULT_COMMAND)) 935 if (mdc800_usb_waitForIRQ (0,TO_DEFAULT_COMMAND))
922 { 936 {
923 err ("Command Timeout."); 937 dev_err(&mdc800->dev->dev, "Command Timeout.\n");
924 mutex_unlock(&mdc800->io_lock); 938 mutex_unlock(&mdc800->io_lock);
925 return -EIO; 939 return -EIO;
926 } 940 }
@@ -1031,7 +1045,7 @@ cleanup_on_fail:
1031 1045
1032 if (mdc800 != NULL) 1046 if (mdc800 != NULL)
1033 { 1047 {
1034 err ("can't alloc memory!"); 1048 printk(KERN_ERR "mdc800: can't alloc memory!\n");
1035 1049
1036 kfree(mdc800->download_urb_buffer); 1050 kfree(mdc800->download_urb_buffer);
1037 kfree(mdc800->write_urb_buffer); 1051 kfree(mdc800->write_urb_buffer);