summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/zoran_card.h
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-07-17 14:29:41 -0700
committerJean Delvare <khali@linux-fr.org>2007-07-17 14:29:41 -0700
commit450ead099a065f8a7e00b476aee04508940856ce (patch)
tree3c3414c89ca36d77214767065beb4b62800efb9f /linux/drivers/media/video/zoran_card.h
parent27a30fb343c7bea52b88474b0b58810a2bc8c35c (diff)
downloadmediapointer-dvb-s2-450ead099a065f8a7e00b476aee04508940856ce.tar.gz
mediapointer-dvb-s2-450ead099a065f8a7e00b476aee04508940856ce.tar.bz2
zr36067: clean up debug function
From: Jean Delvare <khali@linux-fr.org> 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>
Diffstat (limited to 'linux/drivers/media/video/zoran_card.h')
-rw-r--r--linux/drivers/media/video/zoran_card.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/linux/drivers/media/video/zoran_card.h b/linux/drivers/media/video/zoran_card.h
index ad997c30b..8444ca0a5 100644
--- a/linux/drivers/media/video/zoran_card.h
+++ b/linux/drivers/media/video/zoran_card.h
@@ -30,6 +30,14 @@
#ifndef __ZORAN_CARD_H__
#define __ZORAN_CARD_H__
+extern int zr36067_debug;
+
+#define dprintk(num, format, args...) \
+ do { \
+ if (zr36067_debug >= num) \
+ printk(format, ##args); \
+ } while (0)
+
/* Anybody who uses more than four? */
#define BUZ_MAX 4
extern int zoran_num;