diff options
author | Antti Palosaari <crope@iki.fi> | 2012-09-12 19:23:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-23 19:11:01 -0400 |
commit | 20399b3b0e3494ccd4a74bdd86cd870847f196fe (patch) | |
tree | 12a4928b902ca8670752cc02a71d43cd506793a4 /drivers/media/dvb-frontends | |
parent | 8df379c5a425d127216195861b88f981530e7581 (diff) |
[media] ec100: use Kernel dev_foo() logging
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r-- | drivers/media/dvb-frontends/ec100.c | 23 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/ec100.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/ec100_priv.h | 39 |
3 files changed, 11 insertions, 53 deletions
diff --git a/drivers/media/dvb-frontends/ec100.c b/drivers/media/dvb-frontends/ec100.c index c56fddbf53b7..b4ea34c2d09f 100644 --- a/drivers/media/dvb-frontends/ec100.c +++ b/drivers/media/dvb-frontends/ec100.c | |||
@@ -20,13 +20,8 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "dvb_frontend.h" | 22 | #include "dvb_frontend.h" |
23 | #include "ec100_priv.h" | ||
24 | #include "ec100.h" | 23 | #include "ec100.h" |
25 | 24 | ||
26 | int ec100_debug; | ||
27 | module_param_named(debug, ec100_debug, int, 0644); | ||
28 | MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); | ||
29 | |||
30 | struct ec100_state { | 25 | struct ec100_state { |
31 | struct i2c_adapter *i2c; | 26 | struct i2c_adapter *i2c; |
32 | struct dvb_frontend frontend; | 27 | struct dvb_frontend frontend; |
@@ -46,7 +41,8 @@ static int ec100_write_reg(struct ec100_state *state, u8 reg, u8 val) | |||
46 | .buf = buf}; | 41 | .buf = buf}; |
47 | 42 | ||
48 | if (i2c_transfer(state->i2c, &msg, 1) != 1) { | 43 | if (i2c_transfer(state->i2c, &msg, 1) != 1) { |
49 | warn("I2C write failed reg:%02x", reg); | 44 | dev_warn(&state->i2c->dev, "%s: i2c wr failed reg=%02x\n", |
45 | KBUILD_MODNAME, reg); | ||
50 | return -EREMOTEIO; | 46 | return -EREMOTEIO; |
51 | } | 47 | } |
52 | return 0; | 48 | return 0; |
@@ -70,7 +66,8 @@ static int ec100_read_reg(struct ec100_state *state, u8 reg, u8 *val) | |||
70 | }; | 66 | }; |
71 | 67 | ||
72 | if (i2c_transfer(state->i2c, msg, 2) != 2) { | 68 | if (i2c_transfer(state->i2c, msg, 2) != 2) { |
73 | warn("I2C read failed reg:%02x", reg); | 69 | dev_warn(&state->i2c->dev, "%s: i2c rd failed reg=%02x\n", |
70 | KBUILD_MODNAME, reg); | ||
74 | return -EREMOTEIO; | 71 | return -EREMOTEIO; |
75 | } | 72 | } |
76 | return 0; | 73 | return 0; |
@@ -83,8 +80,8 @@ static int ec100_set_frontend(struct dvb_frontend *fe) | |||
83 | int ret; | 80 | int ret; |
84 | u8 tmp, tmp2; | 81 | u8 tmp, tmp2; |
85 | 82 | ||
86 | deb_info("%s: freq:%d bw:%d\n", __func__, c->frequency, | 83 | dev_dbg(&state->i2c->dev, "%s: frequency=%d bandwidth_hz=%d\n", |
87 | c->bandwidth_hz); | 84 | __func__, c->frequency, c->bandwidth_hz); |
88 | 85 | ||
89 | /* program tuner */ | 86 | /* program tuner */ |
90 | if (fe->ops.tuner_ops.set_params) | 87 | if (fe->ops.tuner_ops.set_params) |
@@ -150,7 +147,7 @@ static int ec100_set_frontend(struct dvb_frontend *fe) | |||
150 | 147 | ||
151 | return ret; | 148 | return ret; |
152 | error: | 149 | error: |
153 | deb_info("%s: failed:%d\n", __func__, ret); | 150 | dev_dbg(&state->i2c->dev, "%s: failed=%d\n", __func__, ret); |
154 | return ret; | 151 | return ret; |
155 | } | 152 | } |
156 | 153 | ||
@@ -196,7 +193,7 @@ static int ec100_read_status(struct dvb_frontend *fe, fe_status_t *status) | |||
196 | 193 | ||
197 | return ret; | 194 | return ret; |
198 | error: | 195 | error: |
199 | deb_info("%s: failed:%d\n", __func__, ret); | 196 | dev_dbg(&state->i2c->dev, "%s: failed=%d\n", __func__, ret); |
200 | return ret; | 197 | return ret; |
201 | } | 198 | } |
202 | 199 | ||
@@ -228,7 +225,7 @@ static int ec100_read_ber(struct dvb_frontend *fe, u32 *ber) | |||
228 | 225 | ||
229 | return ret; | 226 | return ret; |
230 | error: | 227 | error: |
231 | deb_info("%s: failed:%d\n", __func__, ret); | 228 | dev_dbg(&state->i2c->dev, "%s: failed=%d\n", __func__, ret); |
232 | return ret; | 229 | return ret; |
233 | } | 230 | } |
234 | 231 | ||
@@ -248,7 +245,7 @@ static int ec100_read_signal_strength(struct dvb_frontend *fe, u16 *strength) | |||
248 | 245 | ||
249 | return ret; | 246 | return ret; |
250 | error: | 247 | error: |
251 | deb_info("%s: failed:%d\n", __func__, ret); | 248 | dev_dbg(&state->i2c->dev, "%s: failed=%d\n", __func__, ret); |
252 | return ret; | 249 | return ret; |
253 | } | 250 | } |
254 | 251 | ||
diff --git a/drivers/media/dvb-frontends/ec100.h b/drivers/media/dvb-frontends/ec100.h index ee8e52417958..b8479719d7f1 100644 --- a/drivers/media/dvb-frontends/ec100.h +++ b/drivers/media/dvb-frontends/ec100.h | |||
@@ -38,7 +38,7 @@ extern struct dvb_frontend *ec100_attach(const struct ec100_config *config, | |||
38 | static inline struct dvb_frontend *ec100_attach( | 38 | static inline struct dvb_frontend *ec100_attach( |
39 | const struct ec100_config *config, struct i2c_adapter *i2c) | 39 | const struct ec100_config *config, struct i2c_adapter *i2c) |
40 | { | 40 | { |
41 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 41 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
42 | return NULL; | 42 | return NULL; |
43 | } | 43 | } |
44 | #endif | 44 | #endif |
diff --git a/drivers/media/dvb-frontends/ec100_priv.h b/drivers/media/dvb-frontends/ec100_priv.h deleted file mode 100644 index 5c990144bc47..000000000000 --- a/drivers/media/dvb-frontends/ec100_priv.h +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * E3C EC100 demodulator driver | ||
3 | * | ||
4 | * Copyright (C) 2009 Antti Palosaari <crope@iki.fi> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #ifndef EC100_PRIV | ||
23 | #define EC100_PRIV | ||
24 | |||
25 | #define LOG_PREFIX "ec100" | ||
26 | |||
27 | #define dprintk(var, level, args...) \ | ||
28 | do { if ((var & level)) printk(args); } while (0) | ||
29 | |||
30 | #define deb_info(args...) dprintk(ec100_debug, 0x01, args) | ||
31 | |||
32 | #undef err | ||
33 | #define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) | ||
34 | #undef info | ||
35 | #define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) | ||
36 | #undef warn | ||
37 | #define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg) | ||
38 | |||
39 | #endif /* EC100_PRIV */ | ||