diff options
author | Michael Krufky <mkrufky@kernellabs.com> | 2009-09-28 02:13:49 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:40:24 -0500 |
commit | c0faeee5a3b70c894a27fa81a0d98a3ab223aff0 (patch) | |
tree | 7cf6b96b1328854a2b1faebf91b5119e77a7b251 /drivers/media/common/tuners/tda18271-priv.h | |
parent | 3a6b49fef6cd18ce3de9de3db12bfbeacf39f9e9 (diff) |
V4L/DVB (13112): tda18271: display some state information in debug output
Display i2c adapter id, address and master / slave role in debug output.
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners/tda18271-priv.h')
-rw-r--r-- | drivers/media/common/tuners/tda18271-priv.h | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/drivers/media/common/tuners/tda18271-priv.h b/drivers/media/common/tuners/tda18271-priv.h index 74075be4dea3..7047680cdbd1 100644 --- a/drivers/media/common/tuners/tda18271-priv.h +++ b/drivers/media/common/tuners/tda18271-priv.h | |||
@@ -136,27 +136,37 @@ extern int tda18271_debug; | |||
136 | #define DBG_ADV 8 | 136 | #define DBG_ADV 8 |
137 | #define DBG_CAL 16 | 137 | #define DBG_CAL 16 |
138 | 138 | ||
139 | #define tda_printk(kern, fmt, arg...) \ | 139 | #define tda_printk(st, kern, fmt, arg...) do {\ |
140 | printk(kern "%s: " fmt, __func__, ##arg) | 140 | if (st) { \ |
141 | 141 | struct tda18271_priv *state = st; \ | |
142 | #define tda_dprintk(lvl, fmt, arg...) do {\ | 142 | printk(kern "%s: [%d-%04x|%s] " fmt, __func__, \ |
143 | i2c_adapter_id(state->i2c_props.adap), \ | ||
144 | state->i2c_props.addr, \ | ||
145 | (state->role == TDA18271_MASTER) \ | ||
146 | ? "M" : "S", ##arg); \ | ||
147 | } else \ | ||
148 | printk(kern "%s: " fmt, __func__, ##arg); \ | ||
149 | } while (0) | ||
150 | |||
151 | #define tda_dprintk(st, lvl, fmt, arg...) do {\ | ||
143 | if (tda18271_debug & lvl) \ | 152 | if (tda18271_debug & lvl) \ |
144 | tda_printk(KERN_DEBUG, fmt, ##arg); } while (0) | 153 | tda_printk(st, KERN_DEBUG, fmt, ##arg); } while (0) |
145 | 154 | ||
146 | #define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) | 155 | #define tda_info(fmt, arg...) printk(KERN_INFO fmt, ##arg) |
147 | #define tda_warn(fmt, arg...) tda_printk(KERN_WARNING, fmt, ##arg) | 156 | #define tda_warn(fmt, arg...) tda_printk(priv, KERN_WARNING, fmt, ##arg) |
148 | #define tda_err(fmt, arg...) tda_printk(KERN_ERR, fmt, ##arg) | 157 | #define tda_err(fmt, arg...) tda_printk(priv, KERN_ERR, fmt, ##arg) |
149 | #define tda_dbg(fmt, arg...) tda_dprintk(DBG_INFO, fmt, ##arg) | 158 | #define tda_dbg(fmt, arg...) tda_dprintk(priv, DBG_INFO, fmt, ##arg) |
150 | #define tda_map(fmt, arg...) tda_dprintk(DBG_MAP, fmt, ##arg) | 159 | #define tda_map(fmt, arg...) tda_dprintk(priv, DBG_MAP, fmt, ##arg) |
151 | #define tda_reg(fmt, arg...) tda_dprintk(DBG_REG, fmt, ##arg) | 160 | #define tda_reg(fmt, arg...) tda_dprintk(priv, DBG_REG, fmt, ##arg) |
152 | #define tda_cal(fmt, arg...) tda_dprintk(DBG_CAL, fmt, ##arg) | 161 | #define tda_cal(fmt, arg...) tda_dprintk(priv, DBG_CAL, fmt, ##arg) |
153 | 162 | ||
154 | #define tda_fail(ret) \ | 163 | #define tda_fail(ret) \ |
155 | ({ \ | 164 | ({ \ |
156 | int __ret; \ | 165 | int __ret; \ |
157 | __ret = (ret < 0); \ | 166 | __ret = (ret < 0); \ |
158 | if (__ret) \ | 167 | if (__ret) \ |
159 | tda_printk(KERN_ERR, "error %d on line %d\n", ret, __LINE__);\ | 168 | tda_printk(priv, KERN_ERR, \ |
169 | "error %d on line %d\n", ret, __LINE__); \ | ||
160 | __ret; \ | 170 | __ret; \ |
161 | }) | 171 | }) |
162 | 172 | ||