diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-07-17 18:29:41 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 22:02:57 -0300 |
commit | 18b548ca580838a2cc5813a941e6dab28660bb22 (patch) | |
tree | 58b2a76ff9108c4e458543d1965e02457843757c /drivers/media/video/zoran_driver.c | |
parent | 63116febb9233743279a05be510ab8524f5f6242 (diff) | |
download | linux-18b548ca580838a2cc5813a941e6dab28660bb22.tar.gz linux-18b548ca580838a2cc5813a941e6dab28660bb22.tar.bz2 linux-18b548ca580838a2cc5813a941e6dab28660bb22.zip |
V4L/DVB (5884): zr36067: clean up debug function
Debugging cleanups to the zr36067 driver:
* Use module_param_named() to declare the debug parameter, so we can
use a single global variable to handle the debug level. This makes
the driver a bit smaller (by 648 bytes on x86_64), thanks to one
less level of indirection on every use.
* Change the debug parameter sysfs permissions, so that the debug
level can be adjusted at runtime, as is done in many other
media/video drivers.
* The debug level is between 0 and 5, not 0 and 4.
* Move the zr_debug export and dprintk macro definition to a header
file so that we don't have to define them in each source file.
* Simplify a duplicate test on zr_debug.
Note that zr_debug was subsequently renamed to debug_zr36067 to avoid
possible conflicts with other Zoran device drivers, on a suggestion
by Trent Piepho.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/zoran_driver.c')
-rw-r--r-- | drivers/media/video/zoran_driver.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c index 72a037b75d63..377bb2d11ffd 100644 --- a/drivers/media/video/zoran_driver.c +++ b/drivers/media/video/zoran_driver.c @@ -200,14 +200,6 @@ const struct zoran_format zoran_formats[] = { // RJ: Test only - want to test BUZ_USE_HIMEM even when CONFIG_BIGPHYS_AREA is defined -extern int *zr_debug; - -#define dprintk(num, format, args...) \ - do { \ - if (*zr_debug >= num) \ - printk(format, ##args); \ - } while (0) - extern int v4l_nbufs; extern int v4l_bufsize; extern int jpg_nbufs; @@ -1106,12 +1098,10 @@ jpg_sync (struct file *file, frame = zr->jpg_pend[zr->jpg_que_tail & BUZ_MASK_FRAME]; /* buffer should now be in BUZ_STATE_DONE */ - if (*zr_debug > 0) - if (zr->jpg_buffers.buffer[frame].state != BUZ_STATE_DONE) - dprintk(2, - KERN_ERR - "%s: jpg_sync() - internal state error\n", - ZR_DEVNAME(zr)); + if (zr->jpg_buffers.buffer[frame].state != BUZ_STATE_DONE) + dprintk(2, + KERN_ERR "%s: jpg_sync() - internal state error\n", + ZR_DEVNAME(zr)); *bs = zr->jpg_buffers.buffer[frame].bs; bs->frame = frame; @@ -1389,7 +1379,7 @@ zoran_close (struct inode *inode, /* disable interrupts */ btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR); - if (*zr_debug > 1) + if (zr36067_debug > 1) print_interrupts(zr); /* Overlay off */ |