aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/si470x/radio-si470x-usb.c
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2009-08-09 13:22:41 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 11:18:40 -0400
commita9d6fd5e316f1bbed08278c88cb984a2616a0278 (patch)
treef973ba3b4a1b65464a2037ddfc46ee190c99c3e6 /drivers/media/radio/si470x/radio-si470x-usb.c
parentb09cd16354454daa1f047b4982691a3826787a0b (diff)
V4L/DVB (12414): radio-si470x: change to dev_* macro from printk
This patch is for using dev_* macro instead of printk. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/si470x/radio-si470x-usb.c')
-rw-r--r--drivers/media/radio/si470x/radio-si470x-usb.c58
1 files changed, 27 insertions, 31 deletions
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c
index f3d805f70996..6508161401f7 100644
--- a/drivers/media/radio/si470x/radio-si470x-usb.c
+++ b/drivers/media/radio/si470x/radio-si470x-usb.c
@@ -223,8 +223,8 @@ static int si470x_get_report(struct si470x_device *radio, void *buf, int size)
223 buf, size, usb_timeout); 223 buf, size, usb_timeout);
224 224
225 if (retval < 0) 225 if (retval < 0)
226 printk(KERN_WARNING DRIVER_NAME 226 dev_warn(&radio->intf->dev,
227 ": si470x_get_report: usb_control_msg returned %d\n", 227 "si470x_get_report: usb_control_msg returned %d\n",
228 retval); 228 retval);
229 return retval; 229 return retval;
230} 230}
@@ -246,8 +246,8 @@ static int si470x_set_report(struct si470x_device *radio, void *buf, int size)
246 buf, size, usb_timeout); 246 buf, size, usb_timeout);
247 247
248 if (retval < 0) 248 if (retval < 0)
249 printk(KERN_WARNING DRIVER_NAME 249 dev_warn(&radio->intf->dev,
250 ": si470x_set_report: usb_control_msg returned %d\n", 250 "si470x_set_report: usb_control_msg returned %d\n",
251 retval); 251 retval);
252 return retval; 252 return retval;
253} 253}
@@ -358,7 +358,7 @@ static int si470x_get_scratch_page_versions(struct si470x_device *radio)
358 retval = si470x_get_report(radio, (void *) &buf, sizeof(buf)); 358 retval = si470x_get_report(radio, (void *) &buf, sizeof(buf));
359 359
360 if (retval < 0) 360 if (retval < 0)
361 printk(KERN_WARNING DRIVER_NAME ": si470x_get_scratch: " 361 dev_warn(&radio->intf->dev, "si470x_get_scratch: "
362 "si470x_get_report returned %d\n", retval); 362 "si470x_get_report returned %d\n", retval);
363 else { 363 else {
364 radio->software_version = buf[1]; 364 radio->software_version = buf[1];
@@ -396,8 +396,8 @@ static void si470x_int_in_callback(struct urb *urb)
396 urb->status == -ESHUTDOWN) { 396 urb->status == -ESHUTDOWN) {
397 return; 397 return;
398 } else { 398 } else {
399 printk(KERN_WARNING DRIVER_NAME 399 dev_warn(&radio->intf->dev,
400 ": non-zero urb status (%d)\n", urb->status); 400 "non-zero urb status (%d)\n", urb->status);
401 goto resubmit; /* Maybe we can recover. */ 401 goto resubmit; /* Maybe we can recover. */
402 } 402 }
403 } 403 }
@@ -482,8 +482,8 @@ resubmit:
482 if (radio->int_in_running && radio->usbdev) { 482 if (radio->int_in_running && radio->usbdev) {
483 retval = usb_submit_urb(radio->int_in_urb, GFP_ATOMIC); 483 retval = usb_submit_urb(radio->int_in_urb, GFP_ATOMIC);
484 if (retval) { 484 if (retval) {
485 printk(KERN_WARNING DRIVER_NAME 485 dev_warn(&radio->intf->dev,
486 ": resubmitting urb failed (%d)", retval); 486 "resubmitting urb failed (%d)", retval);
487 radio->int_in_running = 0; 487 radio->int_in_running = 0;
488 } 488 }
489 } 489 }
@@ -616,8 +616,8 @@ static int si470x_fops_open(struct file *file)
616 616
617 retval = usb_submit_urb(radio->int_in_urb, GFP_KERNEL); 617 retval = usb_submit_urb(radio->int_in_urb, GFP_KERNEL);
618 if (retval) { 618 if (retval) {
619 printk(KERN_INFO DRIVER_NAME 619 dev_info(&radio->intf->dev,
620 ": submitting int urb failed (%d)\n", retval); 620 "submitting int urb failed (%d)\n", retval);
621 radio->int_in_running = 0; 621 radio->int_in_running = 0;
622 usb_autopm_put_interface(radio->intf); 622 usb_autopm_put_interface(radio->intf);
623 } 623 }
@@ -753,8 +753,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
753 radio->int_in_endpoint = endpoint; 753 radio->int_in_endpoint = endpoint;
754 } 754 }
755 if (!radio->int_in_endpoint) { 755 if (!radio->int_in_endpoint) {
756 printk(KERN_INFO DRIVER_NAME 756 dev_info(&intf->dev, "could not find interrupt in endpoint\n");
757 ": could not find interrupt in endpoint\n");
758 retval = -EIO; 757 retval = -EIO;
759 goto err_radio; 758 goto err_radio;
760 } 759 }
@@ -763,15 +762,14 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
763 762
764 radio->int_in_buffer = kmalloc(int_end_size, GFP_KERNEL); 763 radio->int_in_buffer = kmalloc(int_end_size, GFP_KERNEL);
765 if (!radio->int_in_buffer) { 764 if (!radio->int_in_buffer) {
766 printk(KERN_INFO DRIVER_NAME 765 dev_info(&intf->dev, "could not allocate int_in_buffer");
767 "could not allocate int_in_buffer");
768 retval = -ENOMEM; 766 retval = -ENOMEM;
769 goto err_radio; 767 goto err_radio;
770 } 768 }
771 769
772 radio->int_in_urb = usb_alloc_urb(0, GFP_KERNEL); 770 radio->int_in_urb = usb_alloc_urb(0, GFP_KERNEL);
773 if (!radio->int_in_urb) { 771 if (!radio->int_in_urb) {
774 printk(KERN_INFO DRIVER_NAME "could not allocate int_in_urb"); 772 dev_info(&intf->dev, "could not allocate int_in_urb");
775 retval = -ENOMEM; 773 retval = -ENOMEM;
776 goto err_intbuffer; 774 goto err_intbuffer;
777 } 775 }
@@ -791,7 +789,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
791 retval = -EIO; 789 retval = -EIO;
792 goto err_video; 790 goto err_video;
793 } 791 }
794 printk(KERN_INFO DRIVER_NAME ": DeviceID=0x%4.4hx ChipID=0x%4.4hx\n", 792 dev_info(&intf->dev, "DeviceID=0x%4.4hx ChipID=0x%4.4hx\n",
795 radio->registers[DEVICEID], radio->registers[CHIPID]); 793 radio->registers[DEVICEID], radio->registers[CHIPID]);
796 794
797 /* get software and hardware versions */ 795 /* get software and hardware versions */
@@ -799,23 +797,22 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
799 retval = -EIO; 797 retval = -EIO;
800 goto err_video; 798 goto err_video;
801 } 799 }
802 printk(KERN_INFO DRIVER_NAME 800 dev_info(&intf->dev, "software version %d, hardware version %d\n",
803 ": software version %d, hardware version %d\n",
804 radio->software_version, radio->hardware_version); 801 radio->software_version, radio->hardware_version);
805 802
806 /* check if device and firmware is current */ 803 /* check if device and firmware is current */
807 if ((radio->registers[CHIPID] & CHIPID_FIRMWARE) 804 if ((radio->registers[CHIPID] & CHIPID_FIRMWARE)
808 < RADIO_SW_VERSION_CURRENT) { 805 < RADIO_SW_VERSION_CURRENT) {
809 printk(KERN_WARNING DRIVER_NAME 806 dev_warn(&intf->dev,
810 ": This driver is known to work with " 807 "This driver is known to work with "
811 "firmware version %hu,\n", RADIO_SW_VERSION_CURRENT); 808 "firmware version %hu,\n", RADIO_SW_VERSION_CURRENT);
812 printk(KERN_WARNING DRIVER_NAME 809 dev_warn(&intf->dev,
813 ": but the device has firmware version %hu.\n", 810 "but the device has firmware version %hu.\n",
814 radio->registers[CHIPID] & CHIPID_FIRMWARE); 811 radio->registers[CHIPID] & CHIPID_FIRMWARE);
815 printk(KERN_WARNING DRIVER_NAME 812 dev_warn(&intf->dev,
816 ": If you have some trouble using this driver,\n"); 813 "If you have some trouble using this driver,\n");
817 printk(KERN_WARNING DRIVER_NAME 814 dev_warn(&intf->dev,
818 ": please report to V4L ML at " 815 "please report to V4L ML at "
819 "linux-media@vger.kernel.org\n"); 816 "linux-media@vger.kernel.org\n");
820 } 817 }
821 818
@@ -842,8 +839,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
842 retval = video_register_device(radio->videodev, VFL_TYPE_RADIO, 839 retval = video_register_device(radio->videodev, VFL_TYPE_RADIO,
843 radio_nr); 840 radio_nr);
844 if (retval) { 841 if (retval) {
845 printk(KERN_WARNING DRIVER_NAME 842 dev_warn(&intf->dev, "Could not register video device\n");
846 ": Could not register video device\n");
847 goto err_all; 843 goto err_all;
848 } 844 }
849 usb_set_intfdata(intf, radio); 845 usb_set_intfdata(intf, radio);
@@ -868,7 +864,7 @@ err_initial:
868static int si470x_usb_driver_suspend(struct usb_interface *intf, 864static int si470x_usb_driver_suspend(struct usb_interface *intf,
869 pm_message_t message) 865 pm_message_t message)
870{ 866{
871 printk(KERN_INFO DRIVER_NAME ": suspending now...\n"); 867 dev_info(&intf->dev, "suspending now...\n");
872 868
873 return 0; 869 return 0;
874} 870}
@@ -879,7 +875,7 @@ static int si470x_usb_driver_suspend(struct usb_interface *intf,
879 */ 875 */
880static int si470x_usb_driver_resume(struct usb_interface *intf) 876static int si470x_usb_driver_resume(struct usb_interface *intf)
881{ 877{
882 printk(KERN_INFO DRIVER_NAME ": resuming now...\n"); 878 dev_info(&intf->dev, "resuming now...\n");
883 879
884 return 0; 880 return 0;
885} 881}