From ed0e3729c9d790d17688083f070da3674088ea9c Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 1 Nov 2014 08:59:03 -0300 Subject: [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: Mauro Carvalho Chehab --- drivers/media/usb/cx231xx/cx231xx-417.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'drivers/media/usb/cx231xx/cx231xx-417.c') diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index d678f4587ab4..a0d1156d1df1 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -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__); -- cgit