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>
This commit is contained in:
Joonyoung Shim 2009-08-09 14:22:41 -03:00 committed by Mauro Carvalho Chehab
parent b09cd16354
commit a9d6fd5e31
2 changed files with 52 additions and 56 deletions

View file

@ -184,10 +184,10 @@ static int si470x_set_chan(struct si470x_device *radio, unsigned short chan)
} while (((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) && } while (((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) &&
(!timed_out)); (!timed_out));
if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0)
printk(KERN_WARNING DRIVER_NAME ": tune does not complete\n"); dev_warn(&radio->videodev->dev, "tune does not complete\n");
if (timed_out) if (timed_out)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": tune timed out after %u ms\n", tune_timeout); "tune timed out after %u ms\n", tune_timeout);
stop: stop:
/* stop tuning */ /* stop tuning */
@ -320,13 +320,13 @@ static int si470x_set_seek(struct si470x_device *radio,
} while (((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) && } while (((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) &&
(!timed_out)); (!timed_out));
if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0)
printk(KERN_WARNING DRIVER_NAME ": seek does not complete\n"); dev_warn(&radio->videodev->dev, "seek does not complete\n");
if (radio->registers[STATUSRSSI] & STATUSRSSI_SF) if (radio->registers[STATUSRSSI] & STATUSRSSI_SF)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": seek failed / band limit reached\n"); "seek failed / band limit reached\n");
if (timed_out) if (timed_out)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": seek timed out after %u ms\n", seek_timeout); "seek timed out after %u ms\n", seek_timeout);
stop: stop:
/* stop seeking */ /* stop seeking */
@ -435,6 +435,7 @@ int si470x_rds_on(struct si470x_device *radio)
static int si470x_vidioc_queryctrl(struct file *file, void *priv, static int si470x_vidioc_queryctrl(struct file *file, void *priv,
struct v4l2_queryctrl *qc) struct v4l2_queryctrl *qc)
{ {
struct si470x_device *radio = video_drvdata(file);
int retval = -EINVAL; int retval = -EINVAL;
/* abort if qc->id is below V4L2_CID_BASE */ /* abort if qc->id is below V4L2_CID_BASE */
@ -458,8 +459,8 @@ static int si470x_vidioc_queryctrl(struct file *file, void *priv,
done: done:
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": query controls failed with %d\n", retval); "query controls failed with %d\n", retval);
return retval; return retval;
} }
@ -494,8 +495,8 @@ static int si470x_vidioc_g_ctrl(struct file *file, void *priv,
done: done:
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": get control failed with %d\n", retval); "get control failed with %d\n", retval);
return retval; return retval;
} }
@ -534,8 +535,8 @@ static int si470x_vidioc_s_ctrl(struct file *file, void *priv,
done: done:
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": set control failed with %d\n", retval); "set control failed with %d\n", retval);
return retval; return retval;
} }
@ -632,8 +633,8 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
done: done:
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": get tuner failed with %d\n", retval); "get tuner failed with %d\n", retval);
return retval; return retval;
} }
@ -671,8 +672,8 @@ static int si470x_vidioc_s_tuner(struct file *file, void *priv,
done: done:
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": set tuner failed with %d\n", retval); "set tuner failed with %d\n", retval);
return retval; return retval;
} }
@ -701,8 +702,8 @@ static int si470x_vidioc_g_frequency(struct file *file, void *priv,
done: done:
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": get frequency failed with %d\n", retval); "get frequency failed with %d\n", retval);
return retval; return retval;
} }
@ -730,8 +731,8 @@ static int si470x_vidioc_s_frequency(struct file *file, void *priv,
done: done:
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": set frequency failed with %d\n", retval); "set frequency failed with %d\n", retval);
return retval; return retval;
} }
@ -759,9 +760,8 @@ static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv,
done: done:
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->videodev->dev,
": set hardware frequency seek failed with %d\n", "set hardware frequency seek failed with %d\n", retval);
retval);
return retval; return retval;
} }

View file

@ -223,8 +223,8 @@ static int si470x_get_report(struct si470x_device *radio, void *buf, int size)
buf, size, usb_timeout); buf, size, usb_timeout);
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->intf->dev,
": si470x_get_report: usb_control_msg returned %d\n", "si470x_get_report: usb_control_msg returned %d\n",
retval); retval);
return retval; return retval;
} }
@ -246,8 +246,8 @@ static int si470x_set_report(struct si470x_device *radio, void *buf, int size)
buf, size, usb_timeout); buf, size, usb_timeout);
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->intf->dev,
": si470x_set_report: usb_control_msg returned %d\n", "si470x_set_report: usb_control_msg returned %d\n",
retval); retval);
return retval; return retval;
} }
@ -358,7 +358,7 @@ static int si470x_get_scratch_page_versions(struct si470x_device *radio)
retval = si470x_get_report(radio, (void *) &buf, sizeof(buf)); retval = si470x_get_report(radio, (void *) &buf, sizeof(buf));
if (retval < 0) if (retval < 0)
printk(KERN_WARNING DRIVER_NAME ": si470x_get_scratch: " dev_warn(&radio->intf->dev, "si470x_get_scratch: "
"si470x_get_report returned %d\n", retval); "si470x_get_report returned %d\n", retval);
else { else {
radio->software_version = buf[1]; radio->software_version = buf[1];
@ -396,8 +396,8 @@ static void si470x_int_in_callback(struct urb *urb)
urb->status == -ESHUTDOWN) { urb->status == -ESHUTDOWN) {
return; return;
} else { } else {
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->intf->dev,
": non-zero urb status (%d)\n", urb->status); "non-zero urb status (%d)\n", urb->status);
goto resubmit; /* Maybe we can recover. */ goto resubmit; /* Maybe we can recover. */
} }
} }
@ -482,8 +482,8 @@ resubmit:
if (radio->int_in_running && radio->usbdev) { if (radio->int_in_running && radio->usbdev) {
retval = usb_submit_urb(radio->int_in_urb, GFP_ATOMIC); retval = usb_submit_urb(radio->int_in_urb, GFP_ATOMIC);
if (retval) { if (retval) {
printk(KERN_WARNING DRIVER_NAME dev_warn(&radio->intf->dev,
": resubmitting urb failed (%d)", retval); "resubmitting urb failed (%d)", retval);
radio->int_in_running = 0; radio->int_in_running = 0;
} }
} }
@ -616,8 +616,8 @@ static int si470x_fops_open(struct file *file)
retval = usb_submit_urb(radio->int_in_urb, GFP_KERNEL); retval = usb_submit_urb(radio->int_in_urb, GFP_KERNEL);
if (retval) { if (retval) {
printk(KERN_INFO DRIVER_NAME dev_info(&radio->intf->dev,
": submitting int urb failed (%d)\n", retval); "submitting int urb failed (%d)\n", retval);
radio->int_in_running = 0; radio->int_in_running = 0;
usb_autopm_put_interface(radio->intf); usb_autopm_put_interface(radio->intf);
} }
@ -753,8 +753,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
radio->int_in_endpoint = endpoint; radio->int_in_endpoint = endpoint;
} }
if (!radio->int_in_endpoint) { if (!radio->int_in_endpoint) {
printk(KERN_INFO DRIVER_NAME dev_info(&intf->dev, "could not find interrupt in endpoint\n");
": could not find interrupt in endpoint\n");
retval = -EIO; retval = -EIO;
goto err_radio; goto err_radio;
} }
@ -763,15 +762,14 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
radio->int_in_buffer = kmalloc(int_end_size, GFP_KERNEL); radio->int_in_buffer = kmalloc(int_end_size, GFP_KERNEL);
if (!radio->int_in_buffer) { if (!radio->int_in_buffer) {
printk(KERN_INFO DRIVER_NAME dev_info(&intf->dev, "could not allocate int_in_buffer");
"could not allocate int_in_buffer");
retval = -ENOMEM; retval = -ENOMEM;
goto err_radio; goto err_radio;
} }
radio->int_in_urb = usb_alloc_urb(0, GFP_KERNEL); radio->int_in_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!radio->int_in_urb) { if (!radio->int_in_urb) {
printk(KERN_INFO DRIVER_NAME "could not allocate int_in_urb"); dev_info(&intf->dev, "could not allocate int_in_urb");
retval = -ENOMEM; retval = -ENOMEM;
goto err_intbuffer; goto err_intbuffer;
} }
@ -791,7 +789,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
retval = -EIO; retval = -EIO;
goto err_video; goto err_video;
} }
printk(KERN_INFO DRIVER_NAME ": DeviceID=0x%4.4hx ChipID=0x%4.4hx\n", dev_info(&intf->dev, "DeviceID=0x%4.4hx ChipID=0x%4.4hx\n",
radio->registers[DEVICEID], radio->registers[CHIPID]); radio->registers[DEVICEID], radio->registers[CHIPID]);
/* get software and hardware versions */ /* get software and hardware versions */
@ -799,23 +797,22 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
retval = -EIO; retval = -EIO;
goto err_video; goto err_video;
} }
printk(KERN_INFO DRIVER_NAME dev_info(&intf->dev, "software version %d, hardware version %d\n",
": software version %d, hardware version %d\n",
radio->software_version, radio->hardware_version); radio->software_version, radio->hardware_version);
/* check if device and firmware is current */ /* check if device and firmware is current */
if ((radio->registers[CHIPID] & CHIPID_FIRMWARE) if ((radio->registers[CHIPID] & CHIPID_FIRMWARE)
< RADIO_SW_VERSION_CURRENT) { < RADIO_SW_VERSION_CURRENT) {
printk(KERN_WARNING DRIVER_NAME dev_warn(&intf->dev,
": This driver is known to work with " "This driver is known to work with "
"firmware version %hu,\n", RADIO_SW_VERSION_CURRENT); "firmware version %hu,\n", RADIO_SW_VERSION_CURRENT);
printk(KERN_WARNING DRIVER_NAME dev_warn(&intf->dev,
": but the device has firmware version %hu.\n", "but the device has firmware version %hu.\n",
radio->registers[CHIPID] & CHIPID_FIRMWARE); radio->registers[CHIPID] & CHIPID_FIRMWARE);
printk(KERN_WARNING DRIVER_NAME dev_warn(&intf->dev,
": If you have some trouble using this driver,\n"); "If you have some trouble using this driver,\n");
printk(KERN_WARNING DRIVER_NAME dev_warn(&intf->dev,
": please report to V4L ML at " "please report to V4L ML at "
"linux-media@vger.kernel.org\n"); "linux-media@vger.kernel.org\n");
} }
@ -842,8 +839,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
retval = video_register_device(radio->videodev, VFL_TYPE_RADIO, retval = video_register_device(radio->videodev, VFL_TYPE_RADIO,
radio_nr); radio_nr);
if (retval) { if (retval) {
printk(KERN_WARNING DRIVER_NAME dev_warn(&intf->dev, "Could not register video device\n");
": Could not register video device\n");
goto err_all; goto err_all;
} }
usb_set_intfdata(intf, radio); usb_set_intfdata(intf, radio);
@ -868,7 +864,7 @@ err_initial:
static int si470x_usb_driver_suspend(struct usb_interface *intf, static int si470x_usb_driver_suspend(struct usb_interface *intf,
pm_message_t message) pm_message_t message)
{ {
printk(KERN_INFO DRIVER_NAME ": suspending now...\n"); dev_info(&intf->dev, "suspending now...\n");
return 0; return 0;
} }
@ -879,7 +875,7 @@ static int si470x_usb_driver_suspend(struct usb_interface *intf,
*/ */
static int si470x_usb_driver_resume(struct usb_interface *intf) static int si470x_usb_driver_resume(struct usb_interface *intf)
{ {
printk(KERN_INFO DRIVER_NAME ": resuming now...\n"); dev_info(&intf->dev, "resuming now...\n");
return 0; return 0;
} }