aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-06-19 19:59:08 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:22:42 -0400
commitf14d56a99bddb779f6f7ec028bcd9d142536589e (patch)
tree76f0de20e9c43f0c1d5985cd4a75573a2dccd602
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>
-rw-r--r--drivers/media/dvb/siano/smscoreapi.c4
-rw-r--r--drivers/media/dvb/siano/smscoreapi.h20
2 files changed, 21 insertions, 3 deletions
diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c
index 6e2cc3d57161..402ed03be424 100644
--- a/drivers/media/dvb/siano/smscoreapi.c
+++ b/drivers/media/dvb/siano/smscoreapi.c
@@ -33,6 +33,10 @@
33 33
34#include "smscoreapi.h" 34#include "smscoreapi.h"
35 35
36int sms_debug;
37module_param_named(debug, sms_debug, int, 0644);
38MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))");
39
36#define PERROR(fmt, args...)\ 40#define PERROR(fmt, args...)\
37 sms_err("smscore error: line %d- %s(): " fmt, \ 41 sms_err("smscore error: line %d- %s(): " fmt, \
38 __LINE__, __func__, ## args) 42 __LINE__, __func__, ## args)
diff --git a/drivers/media/dvb/siano/smscoreapi.h b/drivers/media/dvb/siano/smscoreapi.h
index ccc7e1012958..a21f01f71ba4 100644
--- a/drivers/media/dvb/siano/smscoreapi.h
+++ b/drivers/media/dvb/siano/smscoreapi.h
@@ -414,12 +414,26 @@ void smsdvb_unregister(void);
414int smsusb_register(void); 414int smsusb_register(void);
415void smsusb_unregister(void); 415void smsusb_unregister(void);
416 416
417/* ------------------------------------------------------------------------ */
418
419extern int sms_debug;
420
421#define DBG_INFO 1
422#define DBG_ADV 2
423
424#define sms_printk(kern, fmt, arg...) \
425 printk(kern "%s: " fmt "\n", __func__, ##arg)
426
427#define dprintk(kern, lvl, fmt, arg...) do {\
428 if (sms_debug & lvl) \
429 sms_printk(kern, fmt, ##arg); } while (0)
430
417#define sms_err(fmt, arg...) \ 431#define sms_err(fmt, arg...) \
418 printk(KERN_ERR "%s " fmt "\n", __func__, ##arg) 432 sms_printk(KERN_ERR, "%s " fmt "\n", __func__, ##arg)
419#define sms_info(fmt, arg...) \ 433#define sms_info(fmt, arg...) \
420 printk(KERN_INFO "%s " fmt "\n", __func__, ##arg) 434 dprintk(KERN_INFO, DBG_INFO, fmt, ##arg)
421#define sms_debug(fmt, arg...) \ 435#define sms_debug(fmt, arg...) \
422 printk(KERN_DEBUG "%s " fmt "\n", __func__, ##arg) 436 dprintk(KERN_DEBUG, DBG_ADV, fmt, ##arg)
423 437
424 438
425#endif /* __smscoreapi_h__ */ 439#endif /* __smscoreapi_h__ */