diff options
| author | Joe Perches <joe@perches.com> | 2011-07-31 03:30:10 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-08-27 10:20:45 -0400 |
| commit | 2b50763a0b082e1fc40cca2a9b8936abf6e2437e (patch) | |
| tree | 59d3782b54db5ecf9d3168502232e48dc4f7bc63 | |
| parent | be85fefecb20b533a2c3f668a345f03f492aeea3 (diff) | |
[media] tda18212: Use standard logging, remove tda18212_priv.h
Use the more current logging styles with pr_fmt.
Remove now unnecessary private include.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
| -rw-r--r-- | drivers/media/common/tuners/tda18212.c | 31 | ||||
| -rw-r--r-- | drivers/media/common/tuners/tda18212_priv.h | 44 |
2 files changed, 23 insertions, 52 deletions
diff --git a/drivers/media/common/tuners/tda18212.c b/drivers/media/common/tuners/tda18212.c index 1f1db20d46b1..e29cc2bc113a 100644 --- a/drivers/media/common/tuners/tda18212.c +++ b/drivers/media/common/tuners/tda18212.c | |||
| @@ -18,7 +18,20 @@ | |||
| 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 | #include "tda18212_priv.h" | 21 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 22 | |||
| 23 | #include "tda18212.h" | ||
| 24 | |||
| 25 | struct tda18212_priv { | ||
| 26 | struct tda18212_config *cfg; | ||
| 27 | struct i2c_adapter *i2c; | ||
| 28 | }; | ||
| 29 | |||
| 30 | #define dbg(fmt, arg...) \ | ||
| 31 | do { \ | ||
| 32 | if (debug) \ | ||
| 33 | pr_info("%s: " fmt, __func__, ##arg); \ | ||
| 34 | } while (0) | ||
| 22 | 35 | ||
| 23 | static int debug; | 36 | static int debug; |
| 24 | module_param(debug, int, 0644); | 37 | module_param(debug, int, 0644); |
| @@ -46,7 +59,8 @@ static int tda18212_wr_regs(struct tda18212_priv *priv, u8 reg, u8 *val, | |||
| 46 | if (ret == 1) { | 59 | if (ret == 1) { |
| 47 | ret = 0; | 60 | ret = 0; |
| 48 | } else { | 61 | } else { |
| 49 | warn("i2c wr failed ret:%d reg:%02x len:%d", ret, reg, len); | 62 | pr_warn("i2c wr failed ret:%d reg:%02x len:%d\n", |
| 63 | ret, reg, len); | ||
| 50 | ret = -EREMOTEIO; | 64 | ret = -EREMOTEIO; |
| 51 | } | 65 | } |
| 52 | return ret; | 66 | return ret; |
| @@ -77,7 +91,8 @@ static int tda18212_rd_regs(struct tda18212_priv *priv, u8 reg, u8 *val, | |||
| 77 | memcpy(val, buf, len); | 91 | memcpy(val, buf, len); |
| 78 | ret = 0; | 92 | ret = 0; |
| 79 | } else { | 93 | } else { |
| 80 | warn("i2c rd failed ret:%d reg:%02x len:%d", ret, reg, len); | 94 | pr_warn("i2c rd failed ret:%d reg:%02x len:%d\n", |
| 95 | ret, reg, len); | ||
| 81 | ret = -EREMOTEIO; | 96 | ret = -EREMOTEIO; |
| 82 | } | 97 | } |
| 83 | 98 | ||
| @@ -129,8 +144,8 @@ static int tda18212_set_params(struct dvb_frontend *fe, | |||
| 129 | { 0x92, 0x53, 0x03 }, /* DVB-C */ | 144 | { 0x92, 0x53, 0x03 }, /* DVB-C */ |
| 130 | }; | 145 | }; |
| 131 | 146 | ||
| 132 | dbg("%s: delsys=%d RF=%d BW=%d", __func__, | 147 | dbg("delsys=%d RF=%d BW=%d\n", |
| 133 | c->delivery_system, c->frequency, c->bandwidth_hz); | 148 | c->delivery_system, c->frequency, c->bandwidth_hz); |
| 134 | 149 | ||
| 135 | if (fe->ops.i2c_gate_ctrl) | 150 | if (fe->ops.i2c_gate_ctrl) |
| 136 | fe->ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */ | 151 | fe->ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */ |
| @@ -196,7 +211,7 @@ exit: | |||
| 196 | return ret; | 211 | return ret; |
| 197 | 212 | ||
| 198 | error: | 213 | error: |
| 199 | dbg("%s: failed:%d", __func__, ret); | 214 | dbg("failed:%d\n", ret); |
| 200 | goto exit; | 215 | goto exit; |
| 201 | } | 216 | } |
| 202 | 217 | ||
| @@ -245,13 +260,13 @@ struct dvb_frontend *tda18212_attach(struct dvb_frontend *fe, | |||
| 245 | if (fe->ops.i2c_gate_ctrl) | 260 | if (fe->ops.i2c_gate_ctrl) |
| 246 | fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */ | 261 | fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */ |
| 247 | 262 | ||
| 248 | dbg("%s: ret:%d chip ID:%02x", __func__, ret, val); | 263 | dbg("ret:%d chip ID:%02x\n", ret, val); |
| 249 | if (ret || val != 0xc7) { | 264 | if (ret || val != 0xc7) { |
| 250 | kfree(priv); | 265 | kfree(priv); |
| 251 | return NULL; | 266 | return NULL; |
| 252 | } | 267 | } |
| 253 | 268 | ||
| 254 | info("NXP TDA18212HN successfully identified."); | 269 | pr_info("NXP TDA18212HN successfully identified\n"); |
| 255 | 270 | ||
| 256 | memcpy(&fe->ops.tuner_ops, &tda18212_tuner_ops, | 271 | memcpy(&fe->ops.tuner_ops, &tda18212_tuner_ops, |
| 257 | sizeof(struct dvb_tuner_ops)); | 272 | sizeof(struct dvb_tuner_ops)); |
diff --git a/drivers/media/common/tuners/tda18212_priv.h b/drivers/media/common/tuners/tda18212_priv.h deleted file mode 100644 index 9adff9356b73..000000000000 --- a/drivers/media/common/tuners/tda18212_priv.h +++ /dev/null | |||
| @@ -1,44 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * NXP TDA18212HN silicon tuner driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 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 along | ||
| 17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef TDA18212_PRIV_H | ||
| 22 | #define TDA18212_PRIV_H | ||
| 23 | |||
| 24 | #include "tda18212.h" | ||
| 25 | |||
| 26 | #define LOG_PREFIX "tda18212" | ||
| 27 | |||
| 28 | #undef dbg | ||
| 29 | #define dbg(f, arg...) \ | ||
| 30 | if (debug) \ | ||
| 31 | printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) | ||
| 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 | struct tda18212_priv { | ||
| 40 | struct tda18212_config *cfg; | ||
| 41 | struct i2c_adapter *i2c; | ||
| 42 | }; | ||
| 43 | |||
| 44 | #endif | ||
