提交 f9195ded 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

V4L/DVB (3347): Fixes some bad global variables

- Debug global var is already used inside kernel, so renamed
debug to tuner_debug for the tuner module
Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 f167cb4e
......@@ -21,7 +21,7 @@ static unsigned int radio_antenna = 0;
module_param(radio_antenna, int, 0644);
/* from tuner-core.c */
extern int debug;
extern int tuner_debug;
/* ---------------------------------------------------------------------- */
......@@ -404,7 +404,7 @@ static void mt2050_set_if_freq(struct i2c_client *c,unsigned int freq, unsigned
div2a=(lo2/8)-1;
div2b=lo2-(div2a+1)*8;
if (debug > 1) {
if (tuner_debug > 1) {
tuner_dbg("lo1 lo2 = %d %d\n", lo1, lo2);
tuner_dbg("num1 num2 div1a div1b div2a div2b= %x %x %x %x %x %x\n",
num1,num2,div1a,div1b,div2a,div2b);
......@@ -420,7 +420,7 @@ static void mt2050_set_if_freq(struct i2c_client *c,unsigned int freq, unsigned
buf[5]=div2a;
if(num2!=0) buf[5]=buf[5]|0x40;
if (debug > 1) {
if (tuner_debug > 1) {
int i;
tuner_dbg("bufs is: ");
for(i=0;i<6;i++)
......@@ -508,7 +508,7 @@ int microtune_init(struct i2c_client *c)
i2c_master_send(c,buf,1);
i2c_master_recv(c,buf,21);
if (debug) {
if (tuner_debug) {
int i;
tuner_dbg("MT20xx hexdump:");
for(i=0;i<21;i++) {
......
......@@ -18,7 +18,7 @@
#define PREFIX "TEA5767 "
/* from tuner-core.c */
extern int debug;
extern int tuner_debug;
/*****************************************************************************/
......@@ -249,7 +249,7 @@ static void set_radio_freq(struct i2c_client *c, unsigned int frq)
if (5 != (rc = i2c_master_send(c, buffer, 5)))
tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc);
if (debug) {
if (tuner_debug) {
if (5 != (rc = i2c_master_recv(c, buffer, 5)))
tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc);
else
......
......@@ -41,8 +41,8 @@ static unsigned int no_autodetect = 0;
static unsigned int show_i2c = 0;
/* insmod options used at runtime => read/write */
static unsigned int tuner_debug = 0;
int debug = 0;
static unsigned int tuner_debug_old = 0;
int tuner_debug = 0;
static unsigned int tv_range[2] = { 44, 958 };
static unsigned int radio_range[2] = { 65, 108 };
......@@ -51,13 +51,13 @@ static char pal[] = "--";
static char secam[] = "--";
static char ntsc[] = "-";
module_param(addr, int, 0444);
module_param(no_autodetect, int, 0444);
module_param(show_i2c, int, 0444);
/* Note: tuner_debug is deprecated and will be removed in 2.6.17 */
module_param(tuner_debug, int, 0444);
module_param(debug, int, 0644);
module_param_named(tuner_debug,tuner_debug_old, int, 0444);
module_param_named(debug,tuner_debug, int, 0644);
module_param_string(pal, pal, sizeof(pal), 0644);
module_param_string(secam, secam, sizeof(secam), 0644);
module_param_string(ntsc, ntsc, sizeof(ntsc), 0644);
......@@ -419,8 +419,8 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
t->radio_if2 = 10700 * 1000; /* 10.7MHz - FM radio */
t->audmode = V4L2_TUNER_MODE_STEREO;
t->mode_mask = T_UNINITIALIZED;
if (tuner_debug) {
debug = tuner_debug;
if (tuner_debug_old) {
tuner_debug = tuner_debug_old;
printk(KERN_ERR "tuner: tuner_debug is deprecated and will be removed in 2.6.17.\n");
printk(KERN_ERR "tuner: use the debug option instead.\n");
}
......@@ -551,7 +551,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
{
struct tuner *t = i2c_get_clientdata(client);
if (debug>1)
if (tuner_debug>1)
v4l_i2c_print_ioctl(&(t->i2c),cmd);
switch (cmd) {
......
......@@ -218,8 +218,8 @@ extern int tea5767_autodetection(struct i2c_client *c);
printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
#define tuner_dbg(fmt, arg...) do {\
extern int debug; \
if (debug) \
extern int tuner_debug; \
if (tuner_debug) \
printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \
i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册