Commit ed0e3729 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] cx231xx: Cleanup printk at the driver

There are lots of debug printks printed with pr_info. Also, the
printk's data are not too coherent:

- there are duplicated driver name at the print format;
- function name format string differs from function to function;
- long strings broken into multiple lines;
- some printks just produce ugly reports, being almost useless
  as-is.

Do a cleanup on that.

Still, there are much to be done in order to do a better printk
job on this driver, but, at least it will now be a way less
verbose, if debug printks are disabled, and some logs might
actually be useful.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 88538bb5
......@@ -90,10 +90,10 @@ static unsigned int v4l_debug = 1;
module_param(v4l_debug, int, 0644);
MODULE_PARM_DESC(v4l_debug, "enable V4L debug messages");
#define dprintk(level, fmt, arg...)\
do { if (v4l_debug >= level) \
pr_info("%s: " fmt, \
(dev) ? dev->name : "cx231xx[?]", ## arg); \
#define dprintk(level, fmt, arg...) \
do { \
if (v4l_debug >= level) \
printk(KERN_DEBUG pr_fmt(fmt), ## arg); \
} while (0)
static struct cx231xx_tvnorm cx231xx_tvnorms[] = {
......@@ -1114,15 +1114,15 @@ static int cx231xx_initialize_codec(struct cx231xx *dev)
cx231xx_disable656(dev);
retval = cx231xx_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); /* ping */
if (retval < 0) {
dprintk(2, "%s() PING OK\n", __func__);
dprintk(2, "%s: PING OK\n", __func__);
retval = cx231xx_load_firmware(dev);
if (retval < 0) {
pr_err("%s() f/w load failed\n", __func__);
pr_err("%s: f/w load failed\n", __func__);
return retval;
}
retval = cx231xx_find_mailbox(dev);
if (retval < 0) {
pr_err("%s() mailbox < 0, error\n",
pr_err("%s: mailbox < 0, error\n",
__func__);
return -1;
}
......@@ -1798,7 +1798,6 @@ static unsigned int mpeg_poll(struct file *file,
static int mpeg_mmap(struct file *file, struct vm_area_struct *vma)
{
struct cx231xx_fh *fh = file->private_data;
struct cx231xx *dev = fh->dev;
dprintk(2, "%s()\n", __func__);
......
......@@ -277,7 +277,7 @@ static int cx231xx_init_audio_isoc(struct cx231xx *dev)
int i, errCode;
int sb_size;
pr_info("%s: Starting ISO AUDIO transfers\n", __func__);
pr_debug("%s: Starting ISO AUDIO transfers\n", __func__);
if (dev->state & DEV_DISCONNECTED)
return -ENODEV;
......@@ -338,7 +338,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev)
int i, errCode;
int sb_size;
pr_info("%s: Starting BULK AUDIO transfers\n", __func__);
pr_debug("%s: Starting BULK AUDIO transfers\n", __func__);
if (dev->state & DEV_DISCONNECTED)
return -ENODEV;
......@@ -439,8 +439,7 @@ static int snd_cx231xx_capture_open(struct snd_pcm_substream *substream)
dprintk("opening device and trying to acquire exclusive lock\n");
if (!dev) {
pr_err("BUG: cx231xx can't find device struct."
" Can't proceed with open\n");
pr_err("BUG: cx231xx can't find device struct. Can't proceed with open\n");
return -ENODEV;
}
......@@ -662,8 +661,7 @@ static int cx231xx_audio_init(struct cx231xx *dev)
return 0;
}
pr_info("cx231xx-audio.c: probing for cx231xx "
"non standard usbaudio\n");
pr_debug("probing for cx231xx non standard usbaudio\n");
err = snd_card_new(&dev->udev->dev, index[devnr], "Cx231xx Audio",
THIS_MODULE, 0, &card);
......@@ -707,14 +705,12 @@ static int cx231xx_audio_init(struct cx231xx *dev)
bEndpointAddress;
adev->num_alt = uif->num_altsetting;
pr_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
adev->end_point_addr, adev->num_alt);
pr_info("audio EndPoint Addr 0x%x, Alternate settings: %i\n",
adev->end_point_addr, adev->num_alt);
adev->alt_max_pkt_size = kmalloc(32 * adev->num_alt, GFP_KERNEL);
if (adev->alt_max_pkt_size == NULL) {
pr_err("out of memory!\n");
if (adev->alt_max_pkt_size == NULL)
return -ENOMEM;
}
for (i = 0; i < adev->num_alt; i++) {
u16 tmp =
......@@ -722,7 +718,7 @@ static int cx231xx_audio_init(struct cx231xx *dev)
wMaxPacketSize);
adev->alt_max_pkt_size[i] =
(tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
pr_info("Alternate setting %i, max size= %i\n", i,
pr_debug("audio alternate setting %i, max size= %i\n", i,
adev->alt_max_pkt_size[i]);
}
......
This diff is collapsed.
......@@ -856,8 +856,7 @@ int cx231xx_tuner_callback(void *ptr, int component, int command, int arg)
if (dev->tuner_type == TUNER_XC5000) {
if (command == XC5000_TUNER_RESET) {
pr_info
("Tuner CB: RESET: cmd %d : tuner type %d \n",
pr_debug("Tuner CB: RESET: cmd %d : tuner type %d \n",
command, dev->tuner_type);
cx231xx_set_gpio_value(dev, dev->board.tuner_gpio->bit,
1);
......@@ -917,7 +916,7 @@ void cx231xx_pre_card_setup(struct cx231xx *dev)
cx231xx_set_model(dev);
pr_info("Identified as %s (card=%d)\n",
dev->board.name, dev->model);
dev->board.name, dev->model);
/* set the direction for GPIO pins */
if (dev->board.tuner_gpio) {
......@@ -1008,7 +1007,7 @@ static int read_eeprom(struct cx231xx *dev, struct i2c_client *client,
}
for (i = 0; i + 15 < len; i += 16)
pr_info("i2c eeprom %02x: %*ph\n", i, 16, &eedata[i]);
pr_debug("i2c eeprom %02x: %*ph\n", i, 16, &eedata[i]);
return 0;
}
......@@ -1028,7 +1027,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
cx231xx_get_i2c_adap(dev, I2C_0),
"cx25840", 0x88 >> 1, NULL);
if (dev->sd_cx25840 == NULL)
pr_info("cx25840 subdev registration failure\n");
pr_err("cx25840 subdev registration failure\n");
cx25840_call(dev, core, load_fw);
}
......@@ -1042,7 +1041,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
"tuner",
dev->tuner_addr, NULL);
if (dev->sd_tuner == NULL)
pr_info("tuner subdev registration failure\n");
pr_err("tuner subdev registration failure\n");
else
cx231xx_config_tuner(dev);
}
......@@ -1290,21 +1289,19 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
dev->video_mode.end_point_addr = uif->altsetting[0].endpoint[isoc_pipe].desc.bEndpointAddress;
dev->video_mode.num_alt = uif->num_altsetting;
pr_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
pr_info("video EndPoint Addr 0x%x, Alternate settings: %i\n",
dev->video_mode.end_point_addr,
dev->video_mode.num_alt);
dev->video_mode.alt_max_pkt_size = devm_kmalloc_array(&udev->dev, 32, dev->video_mode.num_alt, GFP_KERNEL);
if (dev->video_mode.alt_max_pkt_size == NULL) {
pr_err("out of memory!\n");
if (dev->video_mode.alt_max_pkt_size == NULL)
return -ENOMEM;
}
for (i = 0; i < dev->video_mode.num_alt; i++) {
u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.wMaxPacketSize);
dev->video_mode.alt_max_pkt_size[i] = (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
pr_info("Alternate setting %i, max size= %i\n", i,
dev->video_mode.alt_max_pkt_size[i]);
pr_debug("Alternate setting %i, max size= %i\n", i,
dev->video_mode.alt_max_pkt_size[i]);
}
/* VBI Init */
......@@ -1321,16 +1318,14 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
bEndpointAddress;
dev->vbi_mode.num_alt = uif->num_altsetting;
pr_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
pr_info("VBI EndPoint Addr 0x%x, Alternate settings: %i\n",
dev->vbi_mode.end_point_addr,
dev->vbi_mode.num_alt);
/* compute alternate max packet sizes for vbi */
dev->vbi_mode.alt_max_pkt_size = devm_kmalloc_array(&udev->dev, 32, dev->vbi_mode.num_alt, GFP_KERNEL);
if (dev->vbi_mode.alt_max_pkt_size == NULL) {
pr_err("out of memory!\n");
if (dev->vbi_mode.alt_max_pkt_size == NULL)
return -ENOMEM;
}
for (i = 0; i < dev->vbi_mode.num_alt; i++) {
u16 tmp =
......@@ -1338,8 +1333,8 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
desc.wMaxPacketSize);
dev->vbi_mode.alt_max_pkt_size[i] =
(tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
pr_info("Alternate setting %i, max size= %i\n", i,
dev->vbi_mode.alt_max_pkt_size[i]);
pr_debug("Alternate setting %i, max size= %i\n", i,
dev->vbi_mode.alt_max_pkt_size[i]);
}
/* Sliced CC VBI init */
......@@ -1357,23 +1352,20 @@ static int cx231xx_init_v4l2(struct cx231xx *dev,
bEndpointAddress;
dev->sliced_cc_mode.num_alt = uif->num_altsetting;
pr_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
dev->sliced_cc_mode.end_point_addr,
dev->sliced_cc_mode.num_alt);
pr_info("sliced CC EndPoint Addr 0x%x, Alternate settings: %i\n",
dev->sliced_cc_mode.end_point_addr,
dev->sliced_cc_mode.num_alt);
dev->sliced_cc_mode.alt_max_pkt_size = devm_kmalloc_array(&udev->dev, 32, dev->sliced_cc_mode.num_alt, GFP_KERNEL);
if (dev->sliced_cc_mode.alt_max_pkt_size == NULL) {
pr_err("out of memory!\n");
if (dev->sliced_cc_mode.alt_max_pkt_size == NULL)
return -ENOMEM;
}
for (i = 0; i < dev->sliced_cc_mode.num_alt; i++) {
u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].
desc.wMaxPacketSize);
dev->sliced_cc_mode.alt_max_pkt_size[i] =
(tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
pr_info("Alternate setting %i, max size= %i\n", i,
dev->sliced_cc_mode.alt_max_pkt_size[i]);
pr_debug("Alternate setting %i, max size= %i\n", i,
dev->sliced_cc_mode.alt_max_pkt_size[i]);
}
return 0;
......@@ -1410,8 +1402,7 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
nr = find_first_zero_bit(&cx231xx_devused, CX231XX_MAXBOARDS);
if (nr >= CX231XX_MAXBOARDS) {
/* No free device slots */
pr_err(DRIVER_NAME ": Supports only %i devices.\n",
CX231XX_MAXBOARDS);
pr_err("Supports only %i devices.\n", CX231XX_MAXBOARDS);
return -ENOMEM;
}
} while (test_and_set_bit(nr, &cx231xx_devused));
......@@ -1421,7 +1412,6 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
/* allocate memory for our device state and initialize it */
dev = devm_kzalloc(&udev->dev, sizeof(*dev), GFP_KERNEL);
if (dev == NULL) {
pr_err(DRIVER_NAME ": out of memory!\n");
clear_bit(nr, &cx231xx_devused);
return -ENOMEM;
}
......@@ -1468,14 +1458,13 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
speed = "unknown";
}
pr_info("New device %s %s @ %s Mbps "
"(%04x:%04x) with %d interfaces\n",
udev->manufacturer ? udev->manufacturer : "",
udev->product ? udev->product : "",
speed,
le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct),
dev->max_iad_interface_count);
pr_info("New device %s %s @ %s Mbps (%04x:%04x) with %d interfaces\n",
udev->manufacturer ? udev->manufacturer : "",
udev->product ? udev->product : "",
speed,
le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct),
dev->max_iad_interface_count);
/* increment interface count */
dev->interface_count++;
......@@ -1485,13 +1474,12 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
assoc_desc = udev->actconfig->intf_assoc[0];
if (assoc_desc->bFirstInterface != ifnum) {
pr_err(DRIVER_NAME ": Not found "
"matching IAD interface\n");
pr_err("Not found matching IAD interface\n");
retval = -ENODEV;
goto err_if;
}
pr_info("registering interface %d\n", ifnum);
pr_debug("registering interface %d\n", ifnum);
/* save our data pointer in this interface device */
usb_set_intfdata(interface, dev);
......@@ -1527,13 +1515,12 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
desc.bEndpointAddress;
dev->ts1_mode.num_alt = uif->num_altsetting;
pr_info("EndPoint Addr 0x%x, Alternate settings: %i\n",
pr_info("TS EndPoint Addr 0x%x, Alternate settings: %i\n",
dev->ts1_mode.end_point_addr,
dev->ts1_mode.num_alt);
dev->ts1_mode.alt_max_pkt_size = devm_kmalloc_array(&udev->dev, 32, dev->ts1_mode.num_alt, GFP_KERNEL);
if (dev->ts1_mode.alt_max_pkt_size == NULL) {
pr_err("out of memory!\n");
retval = -ENOMEM;
goto err_video_alt;
}
......@@ -1544,7 +1531,7 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
wMaxPacketSize);
dev->ts1_mode.alt_max_pkt_size[i] =
(tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
pr_info("Alternate setting %i, max size= %i\n", i,
pr_debug("Alternate setting %i, max size= %i\n", i,
dev->ts1_mode.alt_max_pkt_size[i]);
}
}
......@@ -1609,10 +1596,8 @@ static void cx231xx_usb_disconnect(struct usb_interface *interface)
wake_up_interruptible_all(&dev->open);
if (dev->users) {
pr_warn
("device %s is open! Deregistration and memory "
"deallocation are deferred on close.\n",
video_device_node_name(dev->vdev));
pr_warn("device %s is open! Deregistration and memory deallocation are deferred on close.\n",
video_device_node_name(dev->vdev));
/* Even having users, it is safe to remove the RC i2c driver */
cx231xx_ir_exit(dev);
......
......@@ -228,9 +228,8 @@ int cx231xx_send_usb_command(struct cx231xx_i2c *i2c_bus,
/* call common vendor command request */
status = cx231xx_send_vendor_cmd(dev, &ven_req);
if (status < 0) {
pr_info
("UsbInterface::sendCommand, failed with status -%d\n",
status);
pr_err("%s: failed with status -%d\n",
__func__, status);
}
return status;
......@@ -524,9 +523,8 @@ int cx231xx_set_video_alternate(struct cx231xx *dev)
usb_set_interface(dev->udev, usb_interface_index,
dev->video_mode.alt);
if (errCode < 0) {
pr_err
("cannot change alt number to %d (error=%i)\n",
dev->video_mode.alt, errCode);
pr_err("cannot change alt number to %d (error=%i)\n",
dev->video_mode.alt, errCode);
return errCode;
}
}
......@@ -600,9 +598,8 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt)
}
if (alt > 0 && max_pkt_size == 0) {
pr_err
("can't change interface %d alt no. to %d: Max. Pkt size = 0\n",
usb_interface_index, alt);
pr_err("can't change interface %d alt no. to %d: Max. Pkt size = 0\n",
usb_interface_index, alt);
/*To workaround error number=-71 on EP0 for videograbber,
need add following codes.*/
if (dev->board.no_alt_vanc)
......@@ -616,9 +613,8 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt)
if (usb_interface_index > 0) {
status = usb_set_interface(dev->udev, usb_interface_index, alt);
if (status < 0) {
pr_err
("can't change interface %d alt no. to %d (err=%i)\n",
usb_interface_index, alt, status);
pr_err("can't change interface %d alt no. to %d (err=%i)\n",
usb_interface_index, alt, status);
return status;
}
}
......@@ -767,17 +763,15 @@ int cx231xx_ep5_bulkout(struct cx231xx *dev, u8 *firmware, u16 size)
u32 *buffer;
buffer = kzalloc(4096, GFP_KERNEL);
if (buffer == NULL) {
pr_info("out of mem\n");
if (buffer == NULL)
return -ENOMEM;
}
memcpy(&buffer[0], firmware, 4096);
ret = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 5),
buffer, 4096, &actlen, 2000);
if (ret)
pr_info("bulk message failed: %d (%d/%d)", ret,
pr_err("bulk message failed: %d (%d/%d)", ret,
size, actlen);
else {
errCode = actlen != size ? -1 : 0;
......@@ -987,12 +981,8 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
cx231xx_uninit_isoc(dev);
dma_q->p_left_data = kzalloc(4096, GFP_KERNEL);
if (dma_q->p_left_data == NULL) {
pr_info("out of mem\n");
if (dma_q->p_left_data == NULL)
return -ENOMEM;
}
dev->video_mode.isoc_ctl.isoc_copy = isoc_copy;
dev->video_mode.isoc_ctl.num_bufs = num_bufs;
......@@ -1055,10 +1045,9 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
&urb->transfer_dma);
if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) {
pr_err("unable to allocate %i bytes for transfer"
" buffer %i%s\n",
sb_size, i,
in_interrupt() ? " while in int" : "");
pr_err("unable to allocate %i bytes for transfer buffer %i%s\n",
sb_size, i,
in_interrupt() ? " while in int" : "");
cx231xx_uninit_isoc(dev);
return -ENOMEM;
}
......@@ -1091,7 +1080,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
GFP_ATOMIC);
if (rc) {
pr_err("submit of urb %i failed (error=%i)\n", i,
rc);
rc);
cx231xx_uninit_isoc(dev);
return rc;
}
......@@ -1189,10 +1178,9 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL,
&urb->transfer_dma);
if (!dev->video_mode.bulk_ctl.transfer_buffer[i]) {
pr_err("unable to allocate %i bytes for transfer"
" buffer %i%s\n",
sb_size, i,
in_interrupt() ? " while in int" : "");
pr_err("unable to allocate %i bytes for transfer buffer %i%s\n",
sb_size, i,
in_interrupt() ? " while in int" : "");
cx231xx_uninit_bulk(dev);
return -ENOMEM;
}
......@@ -1212,8 +1200,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
rc = usb_submit_urb(dev->video_mode.bulk_ctl.urb[i],
GFP_ATOMIC);
if (rc) {
pr_err("submit of urb %i failed (error=%i)\n", i,
rc);
pr_err("submit of urb %i failed (error=%i)\n", i,rc);
cx231xx_uninit_bulk(dev);
return rc;
}
......@@ -1316,18 +1303,16 @@ int cx231xx_dev_init(struct cx231xx *dev)
errCode = cx231xx_set_power_mode(dev,
POLARIS_AVMODE_ENXTERNAL_AV);
if (errCode < 0) {
pr_err
("%s: Failed to set Power - errCode [%d]!\n",
__func__, errCode);
pr_err("%s: Failed to set Power - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
} else {
errCode = cx231xx_set_power_mode(dev,
POLARIS_AVMODE_ANALOGT_TV);
if (errCode < 0) {
pr_err
("%s: Failed to set Power - errCode [%d]!\n",
__func__, errCode);
pr_err("%s: Failed to set Power - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
}
......@@ -1340,34 +1325,30 @@ int cx231xx_dev_init(struct cx231xx *dev)
/* initialize Colibri block */
errCode = cx231xx_afe_init_super_block(dev, 0x23c);
if (errCode < 0) {
pr_err
("%s: cx231xx_afe init super block - errCode [%d]!\n",
__func__, errCode);
pr_err("%s: cx231xx_afe init super block - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
errCode = cx231xx_afe_init_channels(dev);
if (errCode < 0) {
pr_err
("%s: cx231xx_afe init channels - errCode [%d]!\n",
__func__, errCode);
pr_err("%s: cx231xx_afe init channels - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
/* Set DIF in By pass mode */
errCode = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
if (errCode < 0) {
pr_err
("%s: cx231xx_dif set to By pass mode - errCode [%d]!\n",
__func__, errCode);
pr_err("%s: cx231xx_dif set to By pass mode - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
/* I2S block related functions */
errCode = cx231xx_i2s_blk_initialize(dev);
if (errCode < 0) {
pr_err
("%s: cx231xx_i2s block initialize - errCode [%d]!\n",
__func__, errCode);
pr_err("%s: cx231xx_i2s block initialize - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
......@@ -1375,7 +1356,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
errCode = cx231xx_init_ctrl_pin_status(dev);
if (errCode < 0) {
pr_err("%s: cx231xx_init ctrl pins - errCode [%d]!\n",
__func__, errCode);
__func__, errCode);
return errCode;
}
......@@ -1400,9 +1381,8 @@ int cx231xx_dev_init(struct cx231xx *dev)
break;
}
if (errCode < 0) {
pr_err
("%s: cx231xx_AGC mode to Analog - errCode [%d]!\n",
__func__, errCode);
pr_err("%s: cx231xx_AGC mode to Analog - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
......@@ -1477,9 +1457,8 @@ int cx231xx_send_gpio_cmd(struct cx231xx *dev, u32 gpio_bit, u8 *gpio_val,
/* call common vendor command request */
status = cx231xx_send_vendor_cmd(dev, &ven_req);
if (status < 0) {
pr_info
("UsbInterface::sendCommand, failed with status -%d\n",
status);
pr_err("%s: failed with status -%d\n",
__func__, status);
}
return status;
......
......@@ -265,7 +265,7 @@ static int start_streaming(struct cx231xx_dvb *dvb)
struct cx231xx *dev = dvb->adapter.priv;
if (dev->USE_ISO) {
pr_info("DVB transfer mode is ISO.\n");
pr_debug("DVB transfer mode is ISO.\n");
cx231xx_set_alt_setting(dev, INDEX_TS1, 4);
rc = cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE);
if (rc < 0)
......@@ -276,7 +276,7 @@ static int start_streaming(struct cx231xx_dvb *dvb)
dev->ts1_mode.max_pkt_size,
dvb_isoc_copy);
} else {
pr_info("DVB transfer mode is BULK.\n");
pr_debug("DVB transfer mode is BULK.\n");
cx231xx_set_alt_setting(dev, INDEX_TS1, 0);
rc = cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE);
if (rc < 0)
......@@ -430,16 +430,14 @@ int cx231xx_reset_analog_tuner(struct cx231xx *dev)
if (dops->init != NULL && !dev->xc_fw_load_done) {
pr_info("Reloading firmware for XC5000\n");
pr_debug("Reloading firmware for XC5000\n");
status = dops->init(dev->dvb->frontend);
if (status == 0) {
dev->xc_fw_load_done = 1;
pr_info
("XC5000 firmware download completed\n");
pr_debug("XC5000 firmware download completed\n");
} else {
dev->xc_fw_load_done = 0;
pr_info
("XC5000 firmware download failed !!!\n");
pr_debug("XC5000 firmware download failed !!!\n");
}
}
......
......@@ -498,17 +498,18 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port)
memset(&client, 0, sizeof(client));
client.adapter = cx231xx_get_i2c_adap(dev, i2c_port);
pr_info(": Checking for I2C devices on port=%d ..\n", i2c_port);
pr_info("i2c_scan: checking for I2C devices on port=%d ..\n",
i2c_port);
for (i = 0; i < 128; i++) {
client.addr = i;
rc = i2c_master_recv(&client, &buf, 0);
if (rc < 0)
continue;
pr_info("%s: i2c scan: found device @ 0x%x [%s]\n",
dev->name, i << 1,
i2c_devs[i] ? i2c_devs[i] : "???");
pr_info("i2c scan: found device @ 0x%x [%s]\n",
i << 1,
i2c_devs[i] ? i2c_devs[i] : "???");
}
pr_info(": Completed Checking for I2C devices on port=%d.\n",
pr_info("i2c scan: Completed Checking for I2C devices on port=%d.\n",
i2c_port);
}
......@@ -532,8 +533,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
i2c_add_adapter(&bus->i2c_adap);
if (0 != bus->i2c_rc)
pr_warn("%s: i2c bus %d register FAILED\n",
dev->name, bus->nr);
pr_warn("i2c bus %d register FAILED\n", bus->nr);
return bus->i2c_rc;
}
......@@ -576,8 +576,7 @@ int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no)
NULL);
if (!dev->i2c_mux_adap[mux_no])
pr_warn("%s: i2c mux %d register FAILED\n",
dev->name, mux_no);
pr_warn("i2c mux %d register FAILED\n", mux_no);
return 0;
}
......
......@@ -703,9 +703,9 @@ int initialize_cx231xx(struct cx231xx *dev)
_current_scenario_idx = INDEX_BUSPOWER_DIF_ONLY;
break;
default:
pr_info("bad config in buspower!!!!\n");
pr_info("config_info=%x\n",
(config_info & BUSPOWER_MASK));
pr_err("bad config in buspower!!!!\n");
pr_err("config_info=%x\n",
config_info & BUSPOWER_MASK);
return 1;
}
} else { /* self-power */
......@@ -768,9 +768,9 @@ int initialize_cx231xx(struct cx231xx *dev)
_current_scenario_idx = INDEX_SELFPOWER_COMPRESSOR;
break;
default:
pr_info("bad senario!!!!!\n");
pr_info("config_info=%x\n",
(config_info & SELFPOWER_MASK));
pr_err("bad senario!!!!!\n");
pr_err("config_info=%x\n",
config_info & SELFPOWER_MASK);
return -ENODEV;
}
}
......
......@@ -69,11 +69,10 @@ static inline void print_err_status(struct cx231xx *dev, int packet, int status)
break;
}
if (packet < 0) {
pr_err("URB status %d [%s].\n", status,
errmsg);
pr_err("URB status %d [%s].\n", status, errmsg);
} else {
pr_err("URB packet %d, status %d [%s].\n",
packet, status, errmsg);
packet, status, errmsg);
}
}
......@@ -317,7 +316,7 @@ static void cx231xx_irq_vbi_callback(struct urb *urb)
return;
default: /* error */
pr_err("urb completition error %d.\n",
urb->status);
urb->status);
break;
}
......@@ -332,7 +331,7 @@ static void cx231xx_irq_vbi_callback(struct urb *urb)
urb->status = usb_submit_urb(urb, GFP_ATOMIC);
if (urb->status) {
pr_err("urb resubmit failed (error=%i)\n",
urb->status);
urb->status);
}
}
......@@ -344,7 +343,7 @@ void cx231xx_uninit_vbi_isoc(struct cx231xx *dev)
struct urb *urb;
int i;
pr_info("called cx231xx_uninit_vbi_isoc\n");
pr_debug("called cx231xx_uninit_vbi_isoc\n");
dev->vbi_mode.bulk_ctl.nfields = -1;
for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) {
......@@ -393,7 +392,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
struct urb *urb;
int rc;
pr_info("called cx231xx_vbi_isoc\n");
pr_debug("called cx231xx_vbi_isoc\n");
/* De-allocates all pending stuff */
cx231xx_uninit_vbi_isoc(dev);
......@@ -451,9 +450,9 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
dev->vbi_mode.bulk_ctl.transfer_buffer[i] =
kzalloc(sb_size, GFP_KERNEL);
if (!dev->vbi_mode.bulk_ctl.transfer_buffer[i]) {
pr_err("unable to allocate %i bytes for transfer"
" buffer %i%s\n", sb_size, i,
in_interrupt() ? " while in int" : "");
pr_err("unable to allocate %i bytes for transfer buffer %i%s\n",
sb_size, i,
in_interrupt() ? " while in int" : "");
cx231xx_uninit_vbi_isoc(dev);
return -ENOMEM;
}
......@@ -470,8 +469,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
for (i = 0; i < dev->vbi_mode.bulk_ctl.num_bufs; i++) {
rc = usb_submit_urb(dev->vbi_mode.bulk_ctl.urb[i], GFP_ATOMIC);
if (rc) {
pr_err("submit of urb %i failed (error=%i)\n", i,
rc);
pr_err("submit of urb %i failed (error=%i)\n", i, rc);
cx231xx_uninit_vbi_isoc(dev);
return rc;
}
......@@ -522,7 +520,7 @@ static inline void vbi_buffer_filled(struct cx231xx *dev,
struct cx231xx_buffer *buf)
{
/* Advice that buffer was filled */
/* pr_info("[%p/%d] wakeup\n", buf, buf->vb.i); */
/* pr_debug("[%p/%d] wakeup\n", buf, buf->vb.i); */
buf->vb.state = VIDEOBUF_DONE;
buf->vb.field_count++;
......
......@@ -737,7 +737,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
if (!dev->video_mode.bulk_ctl.num_bufs)
urb_init = 1;
}
/*pr_info("urb_init=%d dev->video_mode.max_pkt_size=%d\n",
/*pr_debug("urb_init=%d dev->video_mode.max_pkt_size=%d\n",
urb_init, dev->video_mode.max_pkt_size);*/
if (urb_init) {
dev->mode_tv = 0;
......@@ -809,7 +809,7 @@ void video_mux(struct cx231xx *dev, int index)
cx231xx_set_audio_input(dev, dev->ctl_ainput);
pr_info("video_mux : %d\n", index);
pr_debug("video_mux : %d\n", index);
/* do mode control overrides if required */
cx231xx_do_mode_ctrl_overrides(dev);
......@@ -953,12 +953,12 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
return -EINVAL;
if (videobuf_queue_is_busy(&fh->vb_vidq)) {
pr_err("%s queue busy\n", __func__);
pr_err("%s: queue busy\n", __func__);
return -EBUSY;
}
if (dev->stream_on && !fh->stream_on) {
pr_err("%s device in use by another fh\n", __func__);
pr_err("%s: device in use by another fh\n", __func__);
return -EBUSY;
}
......@@ -1176,9 +1176,8 @@ int cx231xx_s_frequency(struct file *file, void *priv,
int rc;
u32 if_frequency = 5400000;
pr_info("Enter vidioc_s_frequency()f->frequency=%d;f->type=%d\n",
pr_debug("Enter vidioc_s_frequency()f->frequency=%d;f->type=%d\n",
f->frequency, f->type);
/*pr_info("f->type: 1-radio 2-analogTV 3-digitalTV\n");*/
rc = check_dev(dev);
if (rc < 0)
......@@ -1213,13 +1212,13 @@ int cx231xx_s_frequency(struct file *file, void *priv,
else if (dev->norm & V4L2_STD_SECAM_LC)
if_frequency = 1250000; /*1.25MHz */
pr_info("if_frequency is set to %d\n", if_frequency);
pr_debug("if_frequency is set to %d\n", if_frequency);
cx231xx_set_Colibri_For_LowIF(dev, if_frequency, 1, 1);
update_HH_register_after_set_DIF(dev);
}
pr_info("Set New FREQUENCY to %d\n", f->frequency);
pr_debug("Set New FREQUENCY to %d\n", f->frequency);
return rc;
}
......@@ -1642,8 +1641,7 @@ static int cx231xx_v4l2_open(struct file *filp)
#if 0
errCode = cx231xx_set_mode(dev, CX231XX_ANALOG_MODE);
if (errCode < 0) {
pr_err
("Device locked on digital mode. Can't open analog\n");
pr_err("Device locked on digital mode. Can't open analog\n");
return -EBUSY;
}
#endif
......@@ -1737,7 +1735,7 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
}
if (dev->vbi_dev) {
pr_info("V4L2 device %s deregistered\n",
video_device_node_name(dev->vbi_dev));
video_device_node_name(dev->vbi_dev));
if (video_is_registered(dev->vbi_dev))
video_unregister_device(dev->vbi_dev);
else
......@@ -1746,7 +1744,7 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
}
if (dev->vdev) {
pr_info("V4L2 device %s deregistered\n",
video_device_node_name(dev->vdev));
video_device_node_name(dev->vdev));
if (dev->board.has_417)
cx231xx_417_unregister(dev);
......@@ -2080,8 +2078,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
{
int ret;
pr_info("%s: v4l2 driver version %s\n",
dev->name, CX231XX_VERSION);
pr_info("v4l2 driver version %s\n", CX231XX_VERSION);
/* set default norm */
dev->norm = V4L2_STD_PAL;
......@@ -2129,12 +2126,12 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
video_nr[dev->devno]);
if (ret) {
pr_err("unable to register video device (error=%i).\n",
ret);
ret);
return ret;
}
pr_info("%s/0: registered device %s [v4l2]\n",
dev->name, video_device_node_name(dev->vdev));
pr_info("Registered video device %s [v4l2]\n",
video_device_node_name(dev->vdev));
/* Initialize VBI template */
cx231xx_vbi_template = cx231xx_video_template;
......@@ -2156,8 +2153,8 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
return ret;
}
pr_info("%s/0: registered device %s\n",
dev->name, video_device_node_name(dev->vbi_dev));
pr_info("Registered VBI device %s\n",
video_device_node_name(dev->vbi_dev));
if (cx231xx_boards[dev->model].radio.type == CX231XX_RADIO) {
dev->radio_dev = cx231xx_vdev_init(dev, &cx231xx_radio_template,
......@@ -2174,12 +2171,8 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
return ret;
}
pr_info("Registered radio device as %s\n",
video_device_node_name(dev->radio_dev));
video_device_node_name(dev->radio_dev));
}
pr_info("V4L2 device registered as %s and %s\n",
video_device_node_name(dev->vdev),
video_device_node_name(dev->vbi_dev));
return 0;
}
......@@ -809,7 +809,6 @@ void cx231xx_Setup_AFE_for_LowIF(struct cx231xx *dev);
void reset_s5h1432_demod(struct cx231xx *dev);
void cx231xx_dump_HH_reg(struct cx231xx *dev);
void update_HH_register_after_set_DIF(struct cx231xx *dev);
void cx231xx_dump_SC_reg(struct cx231xx *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment