- The pll code was filling up the system log by writing three lines of debug information each time the pll was set. Changed the printk to dprintk. - Add missing log levels to various printks. - Some clean ups. --- bt8xx/dvb-bt8xx.c | 34 ++++++++++++--------------- frontends/cx24110.c | 2 - 3 files changed, 43 insertions(+), 48 deletions(-) --- 0.1/drivers/media/dvb/frontends/cx24110.c Sat, 07 Jan 2006 00:06:16 +0100 froese (kernel-dvb/f/42_cx24110.c 1.1 644) +++ 0.2/drivers/media/dvb/frontends/cx24110.c Sat, 07 Jan 2006 00:53:31 +0100 froese (kernel-dvb/f/42_cx24110.c 1.2 644) @@ -251,7 +251,7 @@ static const u32 bands[]={5000000UL,15000000UL,90999000UL/2}; int i; -dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate); + dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate); if (srate>90999000UL/2) srate=90999000UL/2; if (srate<500000) --- 0.1/drivers/media/dvb/bt8xx/dvb-bt8xx.c Sat, 07 Jan 2006 00:06:16 +0100 froese (kernel-dvb/h/9_dvb-bt8xx. 1.1 644) +++ 0.2/drivers/media/dvb/bt8xx/dvb-bt8xx.c Sat, 07 Jan 2006 00:53:31 +0100 froese (kernel-dvb/h/9_dvb-bt8xx. 1.2 644) @@ -52,8 +52,6 @@ { struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *)data; - //printk("%d ", 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->demux, @@ -198,7 +196,7 @@ 0x00120000,0x00140000}; #define XTAL 1011100 /* Hz, really 1.0111 MHz and a /10 prescaler */ - printk("cx24108 debug: entering SetTunerFreq, freq=%d\n",freq); + dprintk("cx24108 debug: entering SetTunerFreq, freq=%d\n",freq); /* This is really the bit driving the tuner chip cx24108 */ @@ -209,7 +207,7 @@ /* decide which VCO to use for the input frequency */ for(i=1;(i<sizeof(osci)/sizeof(osci[0]))&&(osci[i]<freq);i++); - printk("cx24108 debug: select vco #%d (f=%d)\n",i,freq); + dprintk("cx24108 debug: select vco #%d (f=%d)\n",i,freq); band=bandsel[i]; /* the gain values must be set by SetSymbolrate */ /* compute the pll divider needed, from Conexant data sheet, @@ -225,7 +223,7 @@ ((a&0x1f)<<11); /* everything is shifted left 11 bits to left-align the bits in the 32bit word. Output to the tuner goes MSB-aligned, after all */ - printk("cx24108 debug: pump=%d, n=%d, a=%d\n",pump,n,a); + dprintk("cx24108 debug: pump=%d, n=%d, a=%d\n",pump,n,a); cx24110_pll_write(fe,band); /* set vga and vca to their widest-band settings, as a precaution. SetSymbolrate might not be called to set this up */ @@ -615,7 +613,7 @@ lgdt330x_reset(card); card->fe = lgdt330x_attach(&tdvs_tua6034_config, card->i2c_adapter); if (card->fe != NULL) - dprintk ("dvb_bt8xx: lgdt330x detected\n"); + dprintk("dvb_bt8xx: lgdt330x detected\n"); break; #endif @@ -667,7 +665,7 @@ /* DST is not a frontend, attaching the ASIC */ if ((dst_attach(state, &card->dvb_adapter)) == NULL) { - printk("%s: Could not find a Twinhan DST.\n", __FUNCTION__); + printk(KERN_ERR "%s: Could not find a Twinhan DST.\n", __FUNCTION__); break; } card->fe = &state->frontend; @@ -688,14 +686,14 @@ } if (card->fe == NULL) - printk("dvb-bt8xx: A frontend driver was not found for device %04x/%04x subsystem %04x/%04x\n", + printk(KERN_ERR "dvb-bt8xx: A frontend driver was not found for device %04x/%04x subsystem %04x/%04x\n", card->bt->dev->vendor, card->bt->dev->device, card->bt->dev->subsystem_vendor, card->bt->dev->subsystem_device); else if (dvb_register_frontend(&card->dvb_adapter, card->fe)) { - printk("dvb-bt8xx: Frontend registration failed!\n"); + printk(KERN_ERR "dvb-bt8xx: Frontend registration failed!\n"); if (card->fe->ops->release) card->fe->ops->release(card->fe); card->fe = NULL; @@ -707,7 +705,7 @@ int result; if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE)) < 0) { - printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result); + printk(KERN_ERR "dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result); return result; } card->dvb_adapter.priv = card; @@ -726,7 +724,7 @@ card->demux.write_to_decoder = NULL; if ((result = dvb_dmx_init(&card->demux)) < 0) { - printk("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); + printk(KERN_ERR "dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); dvb_unregister_adapter(&card->dvb_adapter); return result; @@ -737,7 +735,7 @@ card->dmxdev.capabilities = 0; if ((result = dvb_dmxdev_init(&card->dmxdev, &card->dvb_adapter)) < 0) { - printk("dvb_bt8xx: dvb_dmxdev_init failed (errno = %d)\n", result); + printk(KERN_ERR "dvb_bt8xx: dvb_dmxdev_init failed (errno = %d)\n", result); dvb_dmx_release(&card->demux); dvb_unregister_adapter(&card->dvb_adapter); @@ -747,7 +745,7 @@ card->fe_hw.source = DMX_FRONTEND_0; if ((result = card->demux.dmx.add_frontend(&card->demux.dmx, &card->fe_hw)) < 0) { - printk("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); + printk(KERN_ERR "dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); dvb_dmxdev_release(&card->dmxdev); dvb_dmx_release(&card->demux); @@ -758,7 +756,7 @@ card->fe_mem.source = DMX_MEMORY_FE; if ((result = card->demux.dmx.add_frontend(&card->demux.dmx, &card->fe_mem)) < 0) { - printk("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); + printk(KERN_ERR "dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw); dvb_dmxdev_release(&card->dmxdev); @@ -768,7 +766,7 @@ } if ((result = card->demux.dmx.connect_frontend(&card->demux.dmx, &card->fe_hw)) < 0) { - printk("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); + printk(KERN_ERR "dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_mem); card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw); @@ -884,15 +882,15 @@ dprintk("dvb_bt8xx: identified card%d as %s\n", card->bttv_nr, card->card_name); if (!(bttv_pci_dev = bttv_get_pcidev(card->bttv_nr))) { - printk("dvb_bt8xx: no pci device for card %d\n", card->bttv_nr); + printk(KERN_ERR "dvb_bt8xx: no pci device for card %d\n", card->bttv_nr); kfree(card); return -EFAULT; } if (!(card->bt = dvb_bt8xx_878_match(card->bttv_nr, bttv_pci_dev))) { - printk("dvb_bt8xx: unable to determine DMA core of card %d,\n", + printk(KERN_ERR "dvb_bt8xx: unable to determine DMA core of card %d,\n", card->bttv_nr); - printk("dvb_bt8xx: if you have the ALSA bt87x audio driver " + printk(KERN_ERR "dvb_bt8xx: if you have the ALSA bt87x audio driver " "installed, try removing it.\n"); kfree(card); --- 0.1/drivers/media/dvb/bt8xx/bt878.c Sat, 07 Jan 2006 00:06:16 +0100 froese (kernel-dvb/h/16_bt878.c 1.1 644) +++ 0.2/drivers/media/dvb/bt8xx/bt878.c Sat, 07 Jan 2006 00:53:31 +0100 froese (kernel-dvb/h/16_bt878.c 1.2 644) @@ -78,7 +78,8 @@ #if defined(dprintk) #undef dprintk #endif -#define dprintk if(bt878_debug) printk +#define dprintk(args...) do { if (bt878_debug) printk(KERN_DEBUG args); } \ + while (0) static void bt878_mem_free(struct bt878 *bt) { @@ -157,7 +158,7 @@ } if (bt->line_count > 255) { - printk("bt878: buffer size error!\n"); + printk(KERN_ERR "bt878: buffer size error!\n"); return -EINVAL; } return 0; @@ -288,37 +289,34 @@ if (astat & (BT878_ASCERR | BT878_AOCERR)) { if (bt878_verbose) { - printk("bt878(%d): irq%s%s risc_pc=%08x\n", + printk(KERN_ERR + "bt878(%d): irq%s%s risc_pc=%08x\n", bt->nr, - (astat & BT878_ASCERR) ? " SCERR" : - "", - (astat & BT878_AOCERR) ? " OCERR" : - "", btread(BT878_ARISC_PC)); + (astat & BT878_ASCERR) ? " SCERR" : "", + (astat & BT878_AOCERR) ? " OCERR" : "", + btread(BT878_ARISC_PC)); } } if (astat & (BT878_APABORT | BT878_ARIPERR | BT878_APPERR)) { if (bt878_verbose) { - printk - ("bt878(%d): irq%s%s%s risc_pc=%08x\n", - bt->nr, - (astat & BT878_APABORT) ? " PABORT" : - "", - (astat & BT878_ARIPERR) ? " RIPERR" : - "", - (astat & BT878_APPERR) ? " PPERR" : - "", btread(BT878_ARISC_PC)); + printk(KERN_ERR + "bt878(%d): irq%s%s%s risc_pc=%08x\n", + bt->nr, + (astat & BT878_APABORT) ? " PABORT" : "", + (astat & BT878_ARIPERR) ? " RIPERR" : "", + (astat & BT878_APPERR) ? " PPERR" : "", + btread(BT878_ARISC_PC)); } } if (astat & (BT878_AFDSR | BT878_AFTRGT | BT878_AFBUS)) { if (bt878_verbose) { - printk - ("bt878(%d): irq%s%s%s risc_pc=%08x\n", - bt->nr, - (astat & BT878_AFDSR) ? " FDSR" : "", - (astat & BT878_AFTRGT) ? " FTRGT" : - "", - (astat & BT878_AFBUS) ? " FBUS" : "", - btread(BT878_ARISC_PC)); + printk(KERN_ERR + "bt878(%d): irq%s%s%s risc_pc=%08x\n", + bt->nr, + (astat & BT878_AFDSR) ? " FDSR" : "", + (astat & BT878_AFTRGT) ? " FTRGT" : "", + (astat & BT878_AFBUS) ? " FBUS" : "", + btread(BT878_ARISC_PC)); } } if (astat & BT878_ARISCI) { @@ -395,8 +393,7 @@ unsigned int cmd; #endif - printk(KERN_INFO "bt878: Bt878 AUDIO function found (%d).\n", - bt878_num); + printk(KERN_INFO "bt878: DVB interface found (%d).\n", bt878_num); if (pci_enable_device(dev)) return -EIO; @@ -467,7 +464,7 @@ */ if ((result = bt878_mem_alloc(bt))) { - printk("bt878: failed to allocate memory!\n"); + printk(KERN_ERR "bt878: failed to allocate memory!\n"); goto fail2; } @@ -493,7 +490,7 @@ struct bt878 *bt = pci_get_drvdata(pci_dev); if (bt878_verbose) - printk("bt878(%d): unloading\n", bt->nr); + printk(KERN_INFO "bt878(%d): unloading\n", bt->nr); /* turn off all capturing, DMA and IRQs */ btand(~0x13, BT878_AGPIO_DMA_CTL); @@ -553,7 +550,7 @@ bt878_num = 0; bt878_pci_driver_registered = 0; - printk(KERN_INFO "bt878: AUDIO driver version %d.%d.%d loaded\n", + printk(KERN_INFO "bt878: DVB driver version %d.%d.%d loaded\n", (BT878_VERSION_CODE >> 16) & 0xff, (BT878_VERSION_CODE >> 8) & 0xff, BT878_VERSION_CODE & 0xff);