V4L/DVB (3347): Fixes some bad global variables
authorHans Verkuil <hverkuil@xs4all.nl>
Wed, 11 Jan 2006 21:01:01 +0000 (19:01 -0200)
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>
Wed, 11 Jan 2006 22:26:13 +0000 (20:26 -0200)
- Debug global var is already used inside kernel, so renamed
debug to tuner_debug for the tuner module

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/mt20xx.c
drivers/media/video/tea5767.c
drivers/media/video/tuner-core.c
include/media/tuner.h

index 2c19c95..0bf1caa 100644 (file)
@@ -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++) {
index 261b7a3..921fe72 100644 (file)
@@ -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
index 89d013c..f30ef79 100644 (file)
@@ -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) {
index 7674b12..27cbf08 100644 (file)
@@ -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)