diff options
author | Antti Palosaari <crope@iki.fi> | 2012-08-09 19:50:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-12 12:01:33 -0400 |
commit | d46ddbe4bfa8715e3de3227018fbf7a283fde0ec (patch) | |
tree | 37877a4a5ec6e75720f7f0de7a8dd76bcf649329 /drivers/media/common/tuners/tda18212.c | |
parent | e666a44fa313cb9329c0381ad02fc6ee1e21cb31 (diff) |
[media] tda18212: use Kernel dev_* logging
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners/tda18212.c')
-rw-r--r-- | drivers/media/common/tuners/tda18212.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/drivers/media/common/tuners/tda18212.c b/drivers/media/common/tuners/tda18212.c index a14e8b6ef91c..5d9f02842501 100644 --- a/drivers/media/common/tuners/tda18212.c +++ b/drivers/media/common/tuners/tda18212.c | |||
@@ -18,8 +18,6 @@ | |||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
22 | |||
23 | #include "tda18212.h" | 21 | #include "tda18212.h" |
24 | 22 | ||
25 | struct tda18212_priv { | 23 | struct tda18212_priv { |
@@ -29,16 +27,6 @@ struct tda18212_priv { | |||
29 | u32 if_frequency; | 27 | u32 if_frequency; |
30 | }; | 28 | }; |
31 | 29 | ||
32 | #define dbg(fmt, arg...) \ | ||
33 | do { \ | ||
34 | if (debug) \ | ||
35 | pr_info("%s: " fmt, __func__, ##arg); \ | ||
36 | } while (0) | ||
37 | |||
38 | static int debug; | ||
39 | module_param(debug, int, 0644); | ||
40 | MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off)."); | ||
41 | |||
42 | /* write multiple registers */ | 30 | /* write multiple registers */ |
43 | static int tda18212_wr_regs(struct tda18212_priv *priv, u8 reg, u8 *val, | 31 | static int tda18212_wr_regs(struct tda18212_priv *priv, u8 reg, u8 *val, |
44 | int len) | 32 | int len) |
@@ -61,8 +49,8 @@ static int tda18212_wr_regs(struct tda18212_priv *priv, u8 reg, u8 *val, | |||
61 | if (ret == 1) { | 49 | if (ret == 1) { |
62 | ret = 0; | 50 | ret = 0; |
63 | } else { | 51 | } else { |
64 | pr_warn("i2c wr failed ret:%d reg:%02x len:%d\n", | 52 | dev_warn(&priv->i2c->dev, "%s: i2c wr failed=%d reg=%02x " \ |
65 | ret, reg, len); | 53 | "len=%d\n", KBUILD_MODNAME, ret, reg, len); |
66 | ret = -EREMOTEIO; | 54 | ret = -EREMOTEIO; |
67 | } | 55 | } |
68 | return ret; | 56 | return ret; |
@@ -93,8 +81,8 @@ static int tda18212_rd_regs(struct tda18212_priv *priv, u8 reg, u8 *val, | |||
93 | memcpy(val, buf, len); | 81 | memcpy(val, buf, len); |
94 | ret = 0; | 82 | ret = 0; |
95 | } else { | 83 | } else { |
96 | pr_warn("i2c rd failed ret:%d reg:%02x len:%d\n", | 84 | dev_warn(&priv->i2c->dev, "%s: i2c rd failed=%d reg=%02x " \ |
97 | ret, reg, len); | 85 | "len=%d\n", KBUILD_MODNAME, ret, reg, len); |
98 | ret = -EREMOTEIO; | 86 | ret = -EREMOTEIO; |
99 | } | 87 | } |
100 | 88 | ||
@@ -157,8 +145,10 @@ static int tda18212_set_params(struct dvb_frontend *fe) | |||
157 | [DVBC_8] = { 0x92, 0x53, 0x03 }, | 145 | [DVBC_8] = { 0x92, 0x53, 0x03 }, |
158 | }; | 146 | }; |
159 | 147 | ||
160 | dbg("delsys=%d RF=%d BW=%d\n", | 148 | dev_dbg(&priv->i2c->dev, |
161 | c->delivery_system, c->frequency, c->bandwidth_hz); | 149 | "%s: delivery_system=%d frequency=%d bandwidth_hz=%d\n", |
150 | __func__, c->delivery_system, c->frequency, | ||
151 | c->bandwidth_hz); | ||
162 | 152 | ||
163 | if (fe->ops.i2c_gate_ctrl) | 153 | if (fe->ops.i2c_gate_ctrl) |
164 | fe->ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */ | 154 | fe->ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */ |
@@ -247,7 +237,7 @@ exit: | |||
247 | return ret; | 237 | return ret; |
248 | 238 | ||
249 | error: | 239 | error: |
250 | dbg("failed:%d\n", ret); | 240 | dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); |
251 | goto exit; | 241 | goto exit; |
252 | } | 242 | } |
253 | 243 | ||
@@ -306,13 +296,16 @@ struct dvb_frontend *tda18212_attach(struct dvb_frontend *fe, | |||
306 | if (fe->ops.i2c_gate_ctrl) | 296 | if (fe->ops.i2c_gate_ctrl) |
307 | fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */ | 297 | fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */ |
308 | 298 | ||
309 | dbg("ret:%d chip ID:%02x\n", ret, val); | 299 | dev_dbg(&priv->i2c->dev, "%s: ret=%d chip id=%02x\n", __func__, ret, |
300 | val); | ||
310 | if (ret || val != 0xc7) { | 301 | if (ret || val != 0xc7) { |
311 | kfree(priv); | 302 | kfree(priv); |
312 | return NULL; | 303 | return NULL; |
313 | } | 304 | } |
314 | 305 | ||
315 | pr_info("NXP TDA18212HN successfully identified\n"); | 306 | dev_info(&priv->i2c->dev, |
307 | "%s: NXP TDA18212HN successfully identified\n", | ||
308 | KBUILD_MODNAME); | ||
316 | 309 | ||
317 | memcpy(&fe->ops.tuner_ops, &tda18212_tuner_ops, | 310 | memcpy(&fe->ops.tuner_ops, &tda18212_tuner_ops, |
318 | sizeof(struct dvb_tuner_ops)); | 311 | sizeof(struct dvb_tuner_ops)); |