aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/dvb/siano/smscoreapi.h
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-06-19 20:59:08 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 07:22:42 -0300
commitf14d56a99bddb779f6f7ec028bcd9d142536589e (patch)
tree76f0de20e9c43f0c1d5985cd4a75573a2dccd602 /drivers/media/dvb/siano/smscoreapi.h
parenta0c0abcb1fdb316dee3a38cff9843d7d094c327c (diff)
V4L/DVB (8295): sms1xxx: add debug module option, to enable debug messages
All dmesg spam turned off by default, for now. Values for debug: (info=1, adv=2 (or-able) Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/siano/smscoreapi.h')
-rw-r--r--drivers/media/dvb/siano/smscoreapi.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/media/dvb/siano/smscoreapi.h b/drivers/media/dvb/siano/smscoreapi.h
index ccc7e101295..a21f01f71ba 100644
--- a/drivers/media/dvb/siano/smscoreapi.h
+++ b/drivers/media/dvb/siano/smscoreapi.h
@@ -414,12 +414,26 @@ void smsdvb_unregister(void);
int smsusb_register(void);
void smsusb_unregister(void);
+/* ------------------------------------------------------------------------ */
+
+extern int sms_debug;
+
+#define DBG_INFO 1
+#define DBG_ADV 2
+
+#define sms_printk(kern, fmt, arg...) \
+ printk(kern "%s: " fmt "\n", __func__, ##arg)
+
+#define dprintk(kern, lvl, fmt, arg...) do {\
+ if (sms_debug & lvl) \
+ sms_printk(kern, fmt, ##arg); } while (0)
+
#define sms_err(fmt, arg...) \
- printk(KERN_ERR "%s " fmt "\n", __func__, ##arg)
+ sms_printk(KERN_ERR, "%s " fmt "\n", __func__, ##arg)
#define sms_info(fmt, arg...) \
- printk(KERN_INFO "%s " fmt "\n", __func__, ##arg)
+ dprintk(KERN_INFO, DBG_INFO, fmt, ##arg)
#define sms_debug(fmt, arg...) \
- printk(KERN_DEBUG "%s " fmt "\n", __func__, ##arg)
+ dprintk(KERN_DEBUG, DBG_ADV, fmt, ##arg)
#endif /* __smscoreapi_h__ */