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>
This commit is contained in:
Alexey Klimov 2008-11-04 15:02:36 -03:00 committed by Mauro Carvalho Chehab
parent ced07371d9
commit e60b022e13

View File

@ -72,6 +72,11 @@ MODULE_LICENSE("GPL");
#define USB_AMRADIO_VENDOR 0x07ca #define USB_AMRADIO_VENDOR 0x07ca
#define USB_AMRADIO_PRODUCT 0xb800 #define USB_AMRADIO_PRODUCT 0xb800
/* dev_warn macro with driver name */
#define MR800_DRIVER_NAME "radio-mr800"
#define amradio_dev_warn(dev, fmt, arg...) \
dev_warn(dev, MR800_DRIVER_NAME " - " fmt, ##arg)
/* Probably USB_TIMEOUT should be modified in module parameter */ /* Probably USB_TIMEOUT should be modified in module parameter */
#define BUFFER_LENGTH 8 #define BUFFER_LENGTH 8
#define USB_TIMEOUT 500 #define USB_TIMEOUT 500
@ -154,7 +159,7 @@ MODULE_DEVICE_TABLE(usb, usb_amradio_device_table);
/* USB subsystem interface */ /* USB subsystem interface */
static struct usb_driver usb_amradio_driver = { static struct usb_driver usb_amradio_driver = {
.name = "radio-mr800", .name = MR800_DRIVER_NAME,
.probe = usb_amradio_probe, .probe = usb_amradio_probe,
.disconnect = usb_amradio_disconnect, .disconnect = usb_amradio_disconnect,
.suspend = usb_amradio_suspend, .suspend = usb_amradio_suspend,
@ -359,7 +364,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,
radio->curfreq = f->frequency; radio->curfreq = f->frequency;
if (amradio_setfreq(radio, radio->curfreq) < 0) if (amradio_setfreq(radio, radio->curfreq) < 0)
warn("Set frequency failed"); amradio_dev_warn(&radio->videodev->dev,
"set frequency failed\n");
return 0; return 0;
} }
@ -382,8 +388,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) { for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) {
if (qc->id && qc->id == radio_qctrl[i].id) { if (qc->id && qc->id == radio_qctrl[i].id) {
memcpy(qc, &(radio_qctrl[i]), memcpy(qc, &(radio_qctrl[i]), sizeof(*qc));
sizeof(*qc));
return 0; return 0;
} }
} }
@ -414,12 +419,14 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
case V4L2_CID_AUDIO_MUTE: case V4L2_CID_AUDIO_MUTE:
if (ctrl->value) { if (ctrl->value) {
if (amradio_stop(radio) < 0) { if (amradio_stop(radio) < 0) {
warn("amradio_stop() failed"); amradio_dev_warn(&radio->videodev->dev,
"amradio_stop failed\n");
return -1; return -1;
} }
} else { } else {
if (amradio_start(radio) < 0) { if (amradio_start(radio) < 0) {
warn("amradio_start() failed"); amradio_dev_warn(&radio->videodev->dev,
"amradio_start failed\n");
return -1; return -1;
} }
} }
@ -475,13 +482,15 @@ static int usb_amradio_open(struct inode *inode, struct file *file)
radio->muted = 1; radio->muted = 1;
if (amradio_start(radio) < 0) { if (amradio_start(radio) < 0) {
warn("Radio did not start up properly"); amradio_dev_warn(&radio->videodev->dev,
"radio did not start up properly\n");
radio->users = 0; radio->users = 0;
unlock_kernel(); unlock_kernel();
return -EIO; return -EIO;
} }
if (amradio_setfreq(radio, radio->curfreq) < 0) if (amradio_setfreq(radio, radio->curfreq) < 0)
warn("Set frequency failed"); amradio_dev_warn(&radio->videodev->dev,
"set frequency failed\n");
unlock_kernel(); unlock_kernel();
return 0; return 0;
@ -508,9 +517,9 @@ static int usb_amradio_suspend(struct usb_interface *intf, pm_message_t message)
struct amradio_device *radio = usb_get_intfdata(intf); struct amradio_device *radio = usb_get_intfdata(intf);
if (amradio_stop(radio) < 0) if (amradio_stop(radio) < 0)
warn("amradio_stop() failed"); dev_warn(&intf->dev, "amradio_stop failed\n");
info("radio-mr800: Going into suspend.."); dev_info(&intf->dev, "going into suspend..\n");
return 0; return 0;
} }
@ -521,9 +530,9 @@ static int usb_amradio_resume(struct usb_interface *intf)
struct amradio_device *radio = usb_get_intfdata(intf); struct amradio_device *radio = usb_get_intfdata(intf);
if (amradio_start(radio) < 0) if (amradio_start(radio) < 0)
warn("amradio_start() failed"); dev_warn(&intf->dev, "amradio_start failed\n");
info("radio-mr800: Coming out of suspend.."); dev_info(&intf->dev, "coming out of suspend..\n");
return 0; return 0;
} }
@ -602,7 +611,7 @@ static int usb_amradio_probe(struct usb_interface *intf,
video_set_drvdata(radio->videodev, radio); video_set_drvdata(radio->videodev, radio);
if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr)) { if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr)) {
warn("Could not register video device"); dev_warn(&intf->dev, "could not register video device\n");
video_device_release(radio->videodev); video_device_release(radio->videodev);
kfree(radio->buffer); kfree(radio->buffer);
kfree(radio); kfree(radio);
@ -617,9 +626,13 @@ static int __init amradio_init(void)
{ {
int retval = usb_register(&usb_amradio_driver); int retval = usb_register(&usb_amradio_driver);
info(DRIVER_VERSION " " DRIVER_DESC); pr_info(KBUILD_MODNAME
": version " DRIVER_VERSION " " DRIVER_DESC "\n");
if (retval) if (retval)
err("usb_register failed. Error number %d", retval); pr_err(KBUILD_MODNAME
": usb_register failed. Error number %d\n", retval);
return retval; return retval;
} }