diff options
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/tuners/tda18271-maps.c | 1 | ||||
-rw-r--r-- | drivers/media/common/tuners/tda18271-priv.h | 34 |
2 files changed, 23 insertions, 12 deletions
diff --git a/drivers/media/common/tuners/tda18271-maps.c b/drivers/media/common/tuners/tda18271-maps.c index e21fdeff3ddf..e7f84c705da8 100644 --- a/drivers/media/common/tuners/tda18271-maps.c +++ b/drivers/media/common/tuners/tda18271-maps.c | |||
@@ -978,6 +978,7 @@ static struct tda18271_cid_target_map tda18271_cid_target[] = { | |||
978 | int tda18271_lookup_cid_target(struct dvb_frontend *fe, | 978 | int tda18271_lookup_cid_target(struct dvb_frontend *fe, |
979 | u32 *freq, u8 *cid_target, u16 *count_limit) | 979 | u32 *freq, u8 *cid_target, u16 *count_limit) |
980 | { | 980 | { |
981 | struct tda18271_priv *priv = fe->tuner_priv; | ||
981 | int i = 0; | 982 | int i = 0; |
982 | 983 | ||
983 | while ((tda18271_cid_target[i].rfmax * 1000) < *freq) { | 984 | while ((tda18271_cid_target[i].rfmax * 1000) < *freq) { |
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 | ||