aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-mr800.c
diff options
context:
space:
mode:
authorAlexey Klimov <klimov.linux@gmail.com>2008-11-04 13:02:36 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:26 -0500
commite60b022e13c582689e3b38cb41bd5d6539671fae (patch)
tree6d060811811d847429d1931e0e38f05f4dd7755e /drivers/media/radio/radio-mr800.c
parentced07371d931884c9c89b66bfe951ea0148a8d08 (diff)
V4L/DVB (9518): radio-mr800: remove warn, info and err messages
Patch removes warn(), err() and info() statements in drivers/media/radio/radio-mr800.c, and place dev_warn, dev_info in right places. Printk changed on pr_info and pr_err macro. Also new macro amradio_dev_warn defined. Name in usb driver struct changed on MR800_DRIVER_NAME. -- Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Acked-by: David Ellingsworth <david@identd.dyndns.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/radio-mr800.c')
-rw-r--r--drivers/media/radio/radio-mr800.c43
1 files changed, 28 insertions, 15 deletions
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 256cbeffdcb6..61760019b033 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -72,6 +72,11 @@ MODULE_LICENSE("GPL");
72#define USB_AMRADIO_VENDOR 0x07ca 72#define USB_AMRADIO_VENDOR 0x07ca
73#define USB_AMRADIO_PRODUCT 0xb800 73#define USB_AMRADIO_PRODUCT 0xb800
74 74
75/* dev_warn macro with driver name */
76#define MR800_DRIVER_NAME "radio-mr800"
77#define amradio_dev_warn(dev, fmt, arg...) \
78 dev_warn(dev, MR800_DRIVER_NAME " - " fmt, ##arg)
79
75/* Probably USB_TIMEOUT should be modified in module parameter */ 80/* Probably USB_TIMEOUT should be modified in module parameter */
76#define BUFFER_LENGTH 8 81#define BUFFER_LENGTH 8
77#define USB_TIMEOUT 500 82#define USB_TIMEOUT 500
@@ -154,7 +159,7 @@ MODULE_DEVICE_TABLE(usb, usb_amradio_device_table);
154 159
155/* USB subsystem interface */ 160/* USB subsystem interface */
156static struct usb_driver usb_amradio_driver = { 161static struct usb_driver usb_amradio_driver = {
157 .name = "radio-mr800", 162 .name = MR800_DRIVER_NAME,
158 .probe = usb_amradio_probe, 163 .probe = usb_amradio_probe,
159 .disconnect = usb_amradio_disconnect, 164 .disconnect = usb_amradio_disconnect,
160 .suspend = usb_amradio_suspend, 165 .suspend = usb_amradio_suspend,
@@ -359,7 +364,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,
359 364
360 radio->curfreq = f->frequency; 365 radio->curfreq = f->frequency;
361 if (amradio_setfreq(radio, radio->curfreq) < 0) 366 if (amradio_setfreq(radio, radio->curfreq) < 0)
362 warn("Set frequency failed"); 367 amradio_dev_warn(&radio->videodev->dev,
368 "set frequency failed\n");
363 return 0; 369 return 0;
364} 370}
365 371
@@ -382,8 +388,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
382 388
383 for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) { 389 for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) {
384 if (qc->id && qc->id == radio_qctrl[i].id) { 390 if (qc->id && qc->id == radio_qctrl[i].id) {
385 memcpy(qc, &(radio_qctrl[i]), 391 memcpy(qc, &(radio_qctrl[i]), sizeof(*qc));
386 sizeof(*qc));
387 return 0; 392 return 0;
388 } 393 }
389 } 394 }
@@ -414,12 +419,14 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
414 case V4L2_CID_AUDIO_MUTE: 419 case V4L2_CID_AUDIO_MUTE:
415 if (ctrl->value) { 420 if (ctrl->value) {
416 if (amradio_stop(radio) < 0) { 421 if (amradio_stop(radio) < 0) {
417 warn("amradio_stop() failed"); 422 amradio_dev_warn(&radio->videodev->dev,
423 "amradio_stop failed\n");
418 return -1; 424 return -1;
419 } 425 }
420 } else { 426 } else {
421 if (amradio_start(radio) < 0) { 427 if (amradio_start(radio) < 0) {
422 warn("amradio_start() failed"); 428 amradio_dev_warn(&radio->videodev->dev,
429 "amradio_start failed\n");
423 return -1; 430 return -1;
424 } 431 }
425 } 432 }
@@ -475,13 +482,15 @@ static int usb_amradio_open(struct inode *inode, struct file *file)
475 radio->muted = 1; 482 radio->muted = 1;
476 483
477 if (amradio_start(radio) < 0) { 484 if (amradio_start(radio) < 0) {
478 warn("Radio did not start up properly"); 485 amradio_dev_warn(&radio->videodev->dev,
486 "radio did not start up properly\n");
479 radio->users = 0; 487 radio->users = 0;
480 unlock_kernel(); 488 unlock_kernel();
481 return -EIO; 489 return -EIO;
482 } 490 }
483 if (amradio_setfreq(radio, radio->curfreq) < 0) 491 if (amradio_setfreq(radio, radio->curfreq) < 0)
484 warn("Set frequency failed"); 492 amradio_dev_warn(&radio->videodev->dev,
493 "set frequency failed\n");
485 494
486 unlock_kernel(); 495 unlock_kernel();
487 return 0; 496 return 0;
@@ -508,9 +517,9 @@ static int usb_amradio_suspend(struct usb_interface *intf, pm_message_t message)
508 struct amradio_device *radio = usb_get_intfdata(intf); 517 struct amradio_device *radio = usb_get_intfdata(intf);
509 518
510 if (amradio_stop(radio) < 0) 519 if (amradio_stop(radio) < 0)
511 warn("amradio_stop() failed"); 520 dev_warn(&intf->dev, "amradio_stop failed\n");
512 521
513 info("radio-mr800: Going into suspend.."); 522 dev_info(&intf->dev, "going into suspend..\n");
514 523
515 return 0; 524 return 0;
516} 525}
@@ -521,9 +530,9 @@ static int usb_amradio_resume(struct usb_interface *intf)
521 struct amradio_device *radio = usb_get_intfdata(intf); 530 struct amradio_device *radio = usb_get_intfdata(intf);
522 531
523 if (amradio_start(radio) < 0) 532 if (amradio_start(radio) < 0)
524 warn("amradio_start() failed"); 533 dev_warn(&intf->dev, "amradio_start failed\n");
525 534
526 info("radio-mr800: Coming out of suspend.."); 535 dev_info(&intf->dev, "coming out of suspend..\n");
527 536
528 return 0; 537 return 0;
529} 538}
@@ -602,7 +611,7 @@ static int usb_amradio_probe(struct usb_interface *intf,
602 611
603 video_set_drvdata(radio->videodev, radio); 612 video_set_drvdata(radio->videodev, radio);
604 if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr)) { 613 if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr)) {
605 warn("Could not register video device"); 614 dev_warn(&intf->dev, "could not register video device\n");
606 video_device_release(radio->videodev); 615 video_device_release(radio->videodev);
607 kfree(radio->buffer); 616 kfree(radio->buffer);
608 kfree(radio); 617 kfree(radio);
@@ -617,9 +626,13 @@ static int __init amradio_init(void)
617{ 626{
618 int retval = usb_register(&usb_amradio_driver); 627 int retval = usb_register(&usb_amradio_driver);
619 628
620 info(DRIVER_VERSION " " DRIVER_DESC); 629 pr_info(KBUILD_MODNAME
630 ": version " DRIVER_VERSION " " DRIVER_DESC "\n");
631
621 if (retval) 632 if (retval)
622 err("usb_register failed. Error number %d", retval); 633 pr_err(KBUILD_MODNAME
634 ": usb_register failed. Error number %d\n", retval);
635
623 return retval; 636 return retval;
624} 637}
625 638