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

[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: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 7c646913
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -36,6 +38,13 @@ static unsigned int btcx_debug; ...@@ -36,6 +38,13 @@ static unsigned int btcx_debug;
module_param(btcx_debug, int, 0644); module_param(btcx_debug, int, 0644);
MODULE_PARM_DESC(btcx_debug,"debug messages, default is 0 (no)"); 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 */ /* allocate/free risc memory */
...@@ -46,11 +55,11 @@ void btcx_riscmem_free(struct pci_dev *pci, ...@@ -46,11 +55,11 @@ void btcx_riscmem_free(struct pci_dev *pci,
{ {
if (NULL == risc->cpu) if (NULL == risc->cpu)
return; return;
if (btcx_debug) {
memcnt--; memcnt--;
printk("btcx: riscmem free [%d] dma=%lx\n", dprintk("btcx: riscmem free [%d] dma=%lx\n",
memcnt, (unsigned long)risc->dma); memcnt, (unsigned long)risc->dma);
}
pci_free_consistent(pci, risc->size, risc->cpu, risc->dma); pci_free_consistent(pci, risc->size, risc->cpu, risc->dma);
memset(risc,0,sizeof(*risc)); memset(risc,0,sizeof(*risc));
} }
...@@ -71,12 +80,11 @@ int btcx_riscmem_alloc(struct pci_dev *pci, ...@@ -71,12 +80,11 @@ int btcx_riscmem_alloc(struct pci_dev *pci,
risc->cpu = cpu; risc->cpu = cpu;
risc->dma = dma; risc->dma = dma;
risc->size = size; risc->size = size;
if (btcx_debug) {
memcnt++; 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); memcnt, (unsigned long)dma, cpu, size);
} }
}
memset(risc->cpu,0,risc->size); memset(risc->cpu,0,risc->size);
return 0; return 0;
} }
...@@ -137,8 +145,7 @@ btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, unsigned int n, int m ...@@ -137,8 +145,7 @@ btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, unsigned int n, int m
dx = nx - win->left; dx = nx - win->left;
win->left = nx; win->left = nx;
win->width = nw; win->width = nw;
if (btcx_debug) dprintk("btcx: window align %dx%d+%d+%d [dx=%d]\n",
printk(KERN_DEBUG "btcx: window align %dx%d+%d+%d [dx=%d]\n",
win->width, win->height, win->left, win->top, dx); win->width, win->height, win->left, win->top, dx);
/* fixup clips */ /* fixup clips */
...@@ -149,8 +156,7 @@ btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, unsigned int n, int m ...@@ -149,8 +156,7 @@ btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, unsigned int n, int m
nw += mask+1; nw += mask+1;
clips[i].c.left = nx; clips[i].c.left = nx;
clips[i].c.width = nw; clips[i].c.width = nw;
if (btcx_debug) dprintk("btcx: clip align %dx%d+%d+%d\n",
printk(KERN_DEBUG "btcx: clip align %dx%d+%d+%d\n",
clips[i].c.width, clips[i].c.height, clips[i].c.width, clips[i].c.height,
clips[i].c.left, clips[i].c.top); clips[i].c.left, clips[i].c.top);
} }
...@@ -228,10 +234,10 @@ btcx_calc_skips(int line, int width, int *maxy, ...@@ -228,10 +234,10 @@ btcx_calc_skips(int line, int width, int *maxy,
*maxy = maxline; *maxy = maxline;
if (btcx_debug) { 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++) { 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");
} }
} }
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* *
*/ */
#define pr_fmt(fmt) "dvb_bt8xx: " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -44,10 +44,12 @@ MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off)."); ...@@ -44,10 +44,12 @@ MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk( args... ) \ #define dprintk(fmt, arg...) do { \
do { \ if (debug) \
if (debug) printk(KERN_DEBUG args); \ printk(KERN_DEBUG pr_fmt("%s: " fmt), \
} while (0) __func__, ##arg); \
} while (0)
#define IF_FREQUENCYx6 217 /* 6 * 36.16666666667MHz */ #define IF_FREQUENCYx6 217 /* 6 * 36.16666666667MHz */
...@@ -55,7 +57,7 @@ static void dvb_bt8xx_task(unsigned long data) ...@@ -55,7 +57,7 @@ static void dvb_bt8xx_task(unsigned long data)
{ {
struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *)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) { while (card->bt->last_block != card->bt->finished_block) {
(card->bt->TS_Size ? dvb_dmx_swfilter_204 : dvb_dmx_swfilter) (card->bt->TS_Size ? dvb_dmx_swfilter_204 : dvb_dmx_swfilter)
...@@ -443,7 +445,7 @@ static void or51211_reset(struct dvb_frontend * fe) ...@@ -443,7 +445,7 @@ static void or51211_reset(struct dvb_frontend * fe)
/* reset & PRM1,2&4 are outputs */ /* reset & PRM1,2&4 are outputs */
int ret = bttv_gpio_enable(bt->bttv_nr, 0x001F, 0x001F); int ret = bttv_gpio_enable(bt->bttv_nr, 0x001F, 0x001F);
if (ret != 0) 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 */ bttv_write_gpio(bt->bttv_nr, 0x001F, 0x0000); /* Reset */
msleep(20); msleep(20);
/* Now set for normal operation */ /* Now set for normal operation */
...@@ -560,7 +562,8 @@ static void digitv_alps_tded4_reset(struct dvb_bt8xx_card *bt) ...@@ -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); int ret = bttv_gpio_enable(bt->bttv_nr, 0x08, 0x08);
if (ret != 0) 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 */ /* Pulse the reset line */
bttv_write_gpio(bt->bttv_nr, 0x08, 0x08); /* High */ bttv_write_gpio(bt->bttv_nr, 0x08, 0x08); /* High */
...@@ -620,7 +623,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) ...@@ -620,7 +623,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
dvb_attach(simple_tuner_attach, card->fe, dvb_attach(simple_tuner_attach, card->fe,
card->i2c_adapter, 0x61, card->i2c_adapter, 0x61,
TUNER_LG_TDVS_H06XF); TUNER_LG_TDVS_H06XF);
dprintk ("dvb_bt8xx: lgdt330x detected\n"); dprintk("dvb_bt8xx: lgdt330x detected\n");
} }
break; break;
...@@ -635,7 +638,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) ...@@ -635,7 +638,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
card->fe = dvb_attach(nxt6000_attach, &vp3021_alps_tded4_config, card->i2c_adapter); card->fe = dvb_attach(nxt6000_attach, &vp3021_alps_tded4_config, card->i2c_adapter);
if (card->fe != NULL) { if (card->fe != NULL) {
card->fe->ops.tuner_ops.set_params = vp3021_alps_tded4_tuner_set_params; card->fe->ops.tuner_ops.set_params = vp3021_alps_tded4_tuner_set_params;
dprintk ("dvb_bt8xx: an nxt6000 was detected on your digitv card\n"); dprintk("dvb_bt8xx: an nxt6000 was detected on your digitv card\n");
break; break;
} }
...@@ -645,7 +648,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) ...@@ -645,7 +648,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
if (card->fe != NULL) { if (card->fe != NULL) {
card->fe->ops.tuner_ops.calc_regs = digitv_alps_tded4_tuner_calc_regs; card->fe->ops.tuner_ops.calc_regs = digitv_alps_tded4_tuner_calc_regs;
dprintk ("dvb_bt8xx: an mt352 was detected on your digitv card\n"); dprintk("dvb_bt8xx: an mt352 was detected on your digitv card\n");
} }
break; break;
......
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