Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Joe Perches and committed by
Mauro Carvalho Chehab
2b50763a be85fefe

+23 -52
+23 -8
drivers/media/common/tuners/tda18212.c
··· 18 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 36 static int debug; 24 37 module_param(debug, int, 0644); ··· 59 46 if (ret == 1) { 60 47 ret = 0; 61 48 } else { 62 - warn("i2c wr failed ret:%d reg:%02x len:%d", ret, reg, len); 49 + pr_warn("i2c wr failed ret:%d reg:%02x len:%d\n", 50 + ret, reg, len); 63 51 ret = -EREMOTEIO; 64 52 } 65 53 return ret; ··· 91 77 memcpy(val, buf, len); 92 78 ret = 0; 93 79 } else { 94 - warn("i2c rd failed ret:%d reg:%02x len:%d", ret, reg, len); 80 + pr_warn("i2c rd failed ret:%d reg:%02x len:%d\n", 81 + ret, reg, len); 95 82 ret = -EREMOTEIO; 96 83 } 97 84 ··· 144 129 { 0x92, 0x53, 0x03 }, /* DVB-C */ 145 130 }; 146 131 147 - dbg("%s: delsys=%d RF=%d BW=%d", __func__, 148 - c->delivery_system, c->frequency, c->bandwidth_hz); 132 + dbg("delsys=%d RF=%d BW=%d\n", 133 + c->delivery_system, c->frequency, c->bandwidth_hz); 149 134 150 135 if (fe->ops.i2c_gate_ctrl) 151 136 fe->ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */ ··· 211 196 return ret; 212 197 213 198 error: 214 - dbg("%s: failed:%d", __func__, ret); 199 + dbg("failed:%d\n", ret); 215 200 goto exit; 216 201 } 217 202 ··· 260 245 if (fe->ops.i2c_gate_ctrl) 261 246 fe->ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */ 262 247 263 - dbg("%s: ret:%d chip ID:%02x", __func__, ret, val); 248 + dbg("ret:%d chip ID:%02x\n", ret, val); 264 249 if (ret || val != 0xc7) { 265 250 kfree(priv); 266 251 return NULL; 267 252 } 268 253 269 - info("NXP TDA18212HN successfully identified."); 254 + pr_info("NXP TDA18212HN successfully identified\n"); 270 255 271 256 memcpy(&fe->ops.tuner_ops, &tda18212_tuner_ops, 272 257 sizeof(struct dvb_tuner_ops));
-44
drivers/media/common/tuners/tda18212_priv.h
··· 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