[media] bt8xx: use pr_foo() macros instead of printk()

Replace printk() macros by their pr_foo() counterparts, using
pr_cont() for continuation lines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Mauro Carvalho Chehab 2016-10-14 06:33:25 -03:00
parent 7c64691353
commit fa132a64e2
2 changed files with 40 additions and 31 deletions

View File

@ -22,6 +22,8 @@
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
@ -36,6 +38,13 @@ static unsigned int btcx_debug;
module_param(btcx_debug, int, 0644);
MODULE_PARM_DESC(btcx_debug,"debug messages, default is 0 (no)");
#define dprintk(fmt, arg...) do { \
if (btcx_debug) \
printk(KERN_DEBUG pr_fmt("%s: " fmt), \
__func__, ##arg); \
} while (0)
/* ---------------------------------------------------------- */
/* allocate/free risc memory */
@ -46,11 +55,11 @@ void btcx_riscmem_free(struct pci_dev *pci,
{
if (NULL == risc->cpu)
return;
if (btcx_debug) {
memcnt--;
printk("btcx: riscmem free [%d] dma=%lx\n",
dprintk("btcx: riscmem free [%d] dma=%lx\n",
memcnt, (unsigned long)risc->dma);
}
pci_free_consistent(pci, risc->size, risc->cpu, risc->dma);
memset(risc,0,sizeof(*risc));
}
@ -71,12 +80,11 @@ int btcx_riscmem_alloc(struct pci_dev *pci,
risc->cpu = cpu;
risc->dma = dma;
risc->size = size;
if (btcx_debug) {
memcnt++;
printk("btcx: riscmem alloc [%d] dma=%lx cpu=%p size=%d\n",
dprintk("btcx: riscmem alloc [%d] dma=%lx cpu=%p size=%d\n",
memcnt, (unsigned long)dma, cpu, size);
}
}
memset(risc->cpu,0,risc->size);
return 0;
}
@ -137,8 +145,7 @@ btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, unsigned int n, int m
dx = nx - win->left;
win->left = nx;
win->width = nw;
if (btcx_debug)
printk(KERN_DEBUG "btcx: window align %dx%d+%d+%d [dx=%d]\n",
dprintk("btcx: window align %dx%d+%d+%d [dx=%d]\n",
win->width, win->height, win->left, win->top, dx);
/* fixup clips */
@ -149,8 +156,7 @@ btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, unsigned int n, int m
nw += mask+1;
clips[i].c.left = nx;
clips[i].c.width = nw;
if (btcx_debug)
printk(KERN_DEBUG "btcx: clip align %dx%d+%d+%d\n",
dprintk("btcx: clip align %dx%d+%d+%d\n",
clips[i].c.width, clips[i].c.height,
clips[i].c.left, clips[i].c.top);
}
@ -228,10 +234,10 @@ btcx_calc_skips(int line, int width, int *maxy,
*maxy = maxline;
if (btcx_debug) {
printk(KERN_DEBUG "btcx: skips line %d-%d:",line,maxline);
dprintk("btcx: skips line %d-%d:", line, maxline);
for (skip = 0; skip < *nskips; skip++) {
printk(" %d-%d",skips[skip].start,skips[skip].end);
pr_cont(" %d-%d", skips[skip].start, skips[skip].end);
}
printk("\n");
pr_cont("\n");
}
}

View File

@ -19,7 +19,7 @@
*
*/
#define pr_fmt(fmt) "dvb_bt8xx: " fmt
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/bitops.h>
#include <linux/module.h>
@ -44,18 +44,20 @@ MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk( args... ) \
do { \
if (debug) printk(KERN_DEBUG args); \
#define dprintk(fmt, arg...) do { \
if (debug) \
printk(KERN_DEBUG pr_fmt("%s: " fmt), \
__func__, ##arg); \
} while (0)
#define IF_FREQUENCYx6 217 /* 6 * 36.16666666667MHz */
static void dvb_bt8xx_task(unsigned long data)
{
struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *)data;
//printk("%d ", card->bt->finished_block);
dprintk("%d\n", card->bt->finished_block);
while (card->bt->last_block != card->bt->finished_block) {
(card->bt->TS_Size ? dvb_dmx_swfilter_204 : dvb_dmx_swfilter)
@ -443,7 +445,7 @@ static void or51211_reset(struct dvb_frontend * fe)
/* reset & PRM1,2&4 are outputs */
int ret = bttv_gpio_enable(bt->bttv_nr, 0x001F, 0x001F);
if (ret != 0)
printk(KERN_WARNING "or51211: Init Error - Can't Reset DVR (%i)\n", ret);
pr_warn("or51211: Init Error - Can't Reset DVR (%i)\n", ret);
bttv_write_gpio(bt->bttv_nr, 0x001F, 0x0000); /* Reset */
msleep(20);
/* Now set for normal operation */
@ -560,7 +562,8 @@ static void digitv_alps_tded4_reset(struct dvb_bt8xx_card *bt)
int ret = bttv_gpio_enable(bt->bttv_nr, 0x08, 0x08);
if (ret != 0)
printk(KERN_WARNING "digitv_alps_tded4: Init Error - Can't Reset DVR (%i)\n", ret);
pr_warn("digitv_alps_tded4: Init Error - Can't Reset DVR (%i)\n",
ret);
/* Pulse the reset line */
bttv_write_gpio(bt->bttv_nr, 0x08, 0x08); /* High */