diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-11-21 23:42:06 +0000 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-11-21 23:42:06 +0000 |
commit | 300e812db26f4aa022e346f5fb9af1af134d98d8 (patch) | |
tree | 382b45253a704087e8aa0c770bf3fc2ad67d4b02 /drivers/media/common/tuners/tda18271-priv.h | |
parent | 4420dd2b306f1997232a13462bca0d420be5b1b8 (diff) | |
parent | cfcfc9eca2bcbd26a8e206baeb005b055dbf8e37 (diff) |
Merge commit 'v3.2-rc2' into fbdev-next
Diffstat (limited to 'drivers/media/common/tuners/tda18271-priv.h')
-rw-r--r-- | drivers/media/common/tuners/tda18271-priv.h | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/drivers/media/common/tuners/tda18271-priv.h b/drivers/media/common/tuners/tda18271-priv.h index 9589ab0576d..94340f47562 100644 --- a/drivers/media/common/tuners/tda18271-priv.h +++ b/drivers/media/common/tuners/tda18271-priv.h @@ -136,29 +136,26 @@ extern int tda18271_debug; #define DBG_ADV 8 #define DBG_CAL 16 -#define tda_printk(st, kern, fmt, arg...) do {\ - if (st) { \ - struct tda18271_priv *state = st; \ - printk(kern "%s: [%d-%04x|%s] " fmt, __func__, \ - i2c_adapter_id(state->i2c_props.adap), \ - state->i2c_props.addr, \ - (state->role == TDA18271_MASTER) \ - ? "M" : "S", ##arg); \ - } else \ - printk(kern "%s: " fmt, __func__, ##arg); \ +__attribute__((format(printf, 4, 5))) +int _tda_printk(struct tda18271_priv *state, const char *level, + const char *func, const char *fmt, ...); + +#define tda_printk(st, lvl, fmt, arg...) \ + _tda_printk(st, lvl, __func__, fmt, ##arg) + +#define tda_dprintk(st, lvl, fmt, arg...) \ +do { \ + if (tda18271_debug & lvl) \ + tda_printk(st, KERN_DEBUG, fmt, ##arg); \ } while (0) -#define tda_dprintk(st, lvl, fmt, arg...) do {\ - if (tda18271_debug & lvl) \ - tda_printk(st, KERN_DEBUG, fmt, ##arg); } while (0) - -#define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) -#define tda_warn(fmt, arg...) tda_printk(priv, KERN_WARNING, fmt, ##arg) -#define tda_err(fmt, arg...) tda_printk(priv, KERN_ERR, fmt, ##arg) -#define tda_dbg(fmt, arg...) tda_dprintk(priv, DBG_INFO, fmt, ##arg) -#define tda_map(fmt, arg...) tda_dprintk(priv, DBG_MAP, fmt, ##arg) -#define tda_reg(fmt, arg...) tda_dprintk(priv, DBG_REG, fmt, ##arg) -#define tda_cal(fmt, arg...) tda_dprintk(priv, DBG_CAL, fmt, ##arg) +#define tda_info(fmt, arg...) pr_info(fmt, ##arg) +#define tda_warn(fmt, arg...) tda_printk(priv, KERN_WARNING, fmt, ##arg) +#define tda_err(fmt, arg...) tda_printk(priv, KERN_ERR, fmt, ##arg) +#define tda_dbg(fmt, arg...) tda_dprintk(priv, DBG_INFO, fmt, ##arg) +#define tda_map(fmt, arg...) tda_dprintk(priv, DBG_MAP, fmt, ##arg) +#define tda_reg(fmt, arg...) tda_dprintk(priv, DBG_REG, fmt, ##arg) +#define tda_cal(fmt, arg...) tda_dprintk(priv, DBG_CAL, fmt, ##arg) #define tda_fail(ret) \ ({ \ |