aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/media/radio/si470x/radio-si470x-common.c50
-rw-r--r--drivers/media/radio/si470x/radio-si470x-usb.c58
2 files changed, 52 insertions, 56 deletions
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c
index b64559d561e5..fd9fc4aa8fb0 100644
--- a/drivers/media/radio/si470x/radio-si470x-common.c
+++ b/drivers/media/radio/si470x/radio-si470x-common.c
@@ -184,10 +184,10 @@ static int si470x_set_chan(struct si470x_device *radio, unsigned short chan)
184 } while (((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) && 184 } while (((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) &&
185 (!timed_out)); 185 (!timed_out));
186 if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) 186 if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0)
187 printk(KERN_WARNING DRIVER_NAME ": tune does not complete\n"); 187 dev_warn(&radio->videodev->dev, "tune does not complete\n");
188 if (timed_out) 188 if (timed_out)
189 printk(KERN_WARNING DRIVER_NAME 189 dev_warn(&radio->videodev->dev,
190 ": tune timed out after %u ms\n", tune_timeout); 190 "tune timed out after %u ms\n", tune_timeout);
191 191
192stop: 192stop:
193 /* stop tuning */ 193 /* stop tuning */
@@ -320,13 +320,13 @@ static int si470x_set_seek(struct si470x_device *radio,
320 } while (((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) && 320 } while (((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) &&
321 (!timed_out)); 321 (!timed_out));
322 if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) 322 if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0)
323 printk(KERN_WARNING DRIVER_NAME ": seek does not complete\n"); 323 dev_warn(&radio->videodev->dev, "seek does not complete\n");
324 if (radio->registers[STATUSRSSI] & STATUSRSSI_SF) 324 if (radio->registers[STATUSRSSI] & STATUSRSSI_SF)
325 printk(KERN_WARNING DRIVER_NAME 325 dev_warn(&radio->videodev->dev,
326 ": seek failed / band limit reached\n"); 326 "seek failed / band limit reached\n");
327 if (timed_out) 327 if (timed_out)
328 printk(KERN_WARNING DRIVER_NAME 328 dev_warn(&radio->videodev->dev,
329 ": seek timed out after %u ms\n", seek_timeout); 329 "seek timed out after %u ms\n", seek_timeout);
330 330
331stop: 331stop:
332 /* stop seeking */ 332 /* stop seeking */
@@ -435,6 +435,7 @@ int si470x_rds_on(struct si470x_device *radio)
435static int si470x_vidioc_queryctrl(struct file *file, void *priv, 435static int si470x_vidioc_queryctrl(struct file *file, void *priv,
436 struct v4l2_queryctrl *qc) 436 struct v4l2_queryctrl *qc)
437{ 437{
438 struct si470x_device *radio = video_drvdata(file);
438 int retval = -EINVAL; 439 int retval = -EINVAL;
439 440
440 /* abort if qc->id is below V4L2_CID_BASE */ 441 /* abort if qc->id is below V4L2_CID_BASE */
@@ -458,8 +459,8 @@ static int si470x_vidioc_queryctrl(struct file *file, void *priv,
458 459
459done: 460done:
460 if (retval < 0) 461 if (retval < 0)
461 printk(KERN_WARNING DRIVER_NAME 462 dev_warn(&radio->videodev->dev,
462 ": query controls failed with %d\n", retval); 463 "query controls failed with %d\n", retval);
463 return retval; 464 return retval;
464} 465}
465 466
@@ -494,8 +495,8 @@ static int si470x_vidioc_g_ctrl(struct file *file, void *priv,
494 495
495done: 496done:
496 if (retval < 0) 497 if (retval < 0)
497 printk(KERN_WARNING DRIVER_NAME 498 dev_warn(&radio->videodev->dev,
498 ": get control failed with %d\n", retval); 499 "get control failed with %d\n", retval);
499 return retval; 500 return retval;
500} 501}
501 502
@@ -534,8 +535,8 @@ static int si470x_vidioc_s_ctrl(struct file *file, void *priv,
534 535
535done: 536done:
536 if (retval < 0) 537 if (retval < 0)
537 printk(KERN_WARNING DRIVER_NAME 538 dev_warn(&radio->videodev->dev,
538 ": set control failed with %d\n", retval); 539 "set control failed with %d\n", retval);
539 return retval; 540 return retval;
540} 541}
541 542
@@ -632,8 +633,8 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
632 633
633done: 634done:
634 if (retval < 0) 635 if (retval < 0)
635 printk(KERN_WARNING DRIVER_NAME 636 dev_warn(&radio->videodev->dev,
636 ": get tuner failed with %d\n", retval); 637 "get tuner failed with %d\n", retval);
637 return retval; 638 return retval;
638} 639}
639 640
@@ -671,8 +672,8 @@ static int si470x_vidioc_s_tuner(struct file *file, void *priv,
671 672
672done: 673done:
673 if (retval < 0) 674 if (retval < 0)
674 printk(KERN_WARNING DRIVER_NAME 675 dev_warn(&radio->videodev->dev,
675 ": set tuner failed with %d\n", retval); 676 "set tuner failed with %d\n", retval);
676 return retval; 677 return retval;
677} 678}
678 679
@@ -701,8 +702,8 @@ static int si470x_vidioc_g_frequency(struct file *file, void *priv,
701 702
702done: 703done:
703 if (retval < 0) 704 if (retval < 0)
704 printk(KERN_WARNING DRIVER_NAME 705 dev_warn(&radio->videodev->dev,
705 ": get frequency failed with %d\n", retval); 706 "get frequency failed with %d\n", retval);
706 return retval; 707 return retval;
707} 708}
708 709
@@ -730,8 +731,8 @@ static int si470x_vidioc_s_frequency(struct file *file, void *priv,
730 731
731done: 732done:
732 if (retval < 0) 733 if (retval < 0)
733 printk(KERN_WARNING DRIVER_NAME 734 dev_warn(&radio->videodev->dev,
734 ": set frequency failed with %d\n", retval); 735 "set frequency failed with %d\n", retval);
735 return retval; 736 return retval;
736} 737}
737 738
@@ -759,9 +760,8 @@ static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv,
759 760
760done: 761done:
761 if (retval < 0) 762 if (retval < 0)
762 printk(KERN_WARNING DRIVER_NAME 763 dev_warn(&radio->videodev->dev,
763 ": set hardware frequency seek failed with %d\n", 764 "set hardware frequency seek failed with %d\n", retval);
764 retval);
765 return retval; 765 return retval;
766} 766}
767 767
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}