From: Hans Verkuil Date: Wed, 11 Jan 2006 21:01:01 +0000 (-0200) Subject: V4L/DVB (3347): Fixes some bad global variables X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=f9195ded25a4e8fba09c67aa24b42cd98a242d7d;p=deliverable%2Flinux.git 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: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c index 2c19c9588c02..0bf1caac5887 100644 --- a/drivers/media/video/mt20xx.c +++ b/drivers/media/video/mt20xx.c @@ -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++) { diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c index 261b7a3c0417..921fe72f23d5 100644 --- a/drivers/media/video/tea5767.c +++ b/drivers/media/video/tea5767.c @@ -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 diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 89d013ce5edb..f30ef79d795e 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -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) { diff --git a/include/media/tuner.h b/include/media/tuner.h index 7674b121ce8b..27cbf08c931d 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -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)