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 <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by Hans Verkuil and committed by Mauro Carvalho Chehab f9195ded f167cb4e

+16 -16
+4 -4
drivers/media/video/mt20xx.c
··· 21 module_param(radio_antenna, int, 0644); 22 23 /* from tuner-core.c */ 24 - extern int debug; 25 26 /* ---------------------------------------------------------------------- */ 27 ··· 404 div2a=(lo2/8)-1; 405 div2b=lo2-(div2a+1)*8; 406 407 - if (debug > 1) { 408 tuner_dbg("lo1 lo2 = %d %d\n", lo1, lo2); 409 tuner_dbg("num1 num2 div1a div1b div2a div2b= %x %x %x %x %x %x\n", 410 num1,num2,div1a,div1b,div2a,div2b); ··· 420 buf[5]=div2a; 421 if(num2!=0) buf[5]=buf[5]|0x40; 422 423 - if (debug > 1) { 424 int i; 425 tuner_dbg("bufs is: "); 426 for(i=0;i<6;i++) ··· 508 509 i2c_master_send(c,buf,1); 510 i2c_master_recv(c,buf,21); 511 - if (debug) { 512 int i; 513 tuner_dbg("MT20xx hexdump:"); 514 for(i=0;i<21;i++) {
··· 21 module_param(radio_antenna, int, 0644); 22 23 /* from tuner-core.c */ 24 + extern int tuner_debug; 25 26 /* ---------------------------------------------------------------------- */ 27 ··· 404 div2a=(lo2/8)-1; 405 div2b=lo2-(div2a+1)*8; 406 407 + if (tuner_debug > 1) { 408 tuner_dbg("lo1 lo2 = %d %d\n", lo1, lo2); 409 tuner_dbg("num1 num2 div1a div1b div2a div2b= %x %x %x %x %x %x\n", 410 num1,num2,div1a,div1b,div2a,div2b); ··· 420 buf[5]=div2a; 421 if(num2!=0) buf[5]=buf[5]|0x40; 422 423 + if (tuner_debug > 1) { 424 int i; 425 tuner_dbg("bufs is: "); 426 for(i=0;i<6;i++) ··· 508 509 i2c_master_send(c,buf,1); 510 i2c_master_recv(c,buf,21); 511 + if (tuner_debug) { 512 int i; 513 tuner_dbg("MT20xx hexdump:"); 514 for(i=0;i<21;i++) {
+2 -2
drivers/media/video/tea5767.c
··· 18 #define PREFIX "TEA5767 " 19 20 /* from tuner-core.c */ 21 - extern int debug; 22 23 /*****************************************************************************/ 24 ··· 249 if (5 != (rc = i2c_master_send(c, buffer, 5))) 250 tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); 251 252 - if (debug) { 253 if (5 != (rc = i2c_master_recv(c, buffer, 5))) 254 tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); 255 else
··· 18 #define PREFIX "TEA5767 " 19 20 /* from tuner-core.c */ 21 + extern int tuner_debug; 22 23 /*****************************************************************************/ 24 ··· 249 if (5 != (rc = i2c_master_send(c, buffer, 5))) 250 tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); 251 252 + if (tuner_debug) { 253 if (5 != (rc = i2c_master_recv(c, buffer, 5))) 254 tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); 255 else
+8 -8
drivers/media/video/tuner-core.c
··· 41 static unsigned int show_i2c = 0; 42 43 /* insmod options used at runtime => read/write */ 44 - static unsigned int tuner_debug = 0; 45 - int debug = 0; 46 47 static unsigned int tv_range[2] = { 44, 958 }; 48 static unsigned int radio_range[2] = { 65, 108 }; ··· 51 static char secam[] = "--"; 52 static char ntsc[] = "-"; 53 54 module_param(addr, int, 0444); 55 module_param(no_autodetect, int, 0444); 56 module_param(show_i2c, int, 0444); 57 /* Note: tuner_debug is deprecated and will be removed in 2.6.17 */ 58 - module_param(tuner_debug, int, 0444); 59 - module_param(debug, int, 0644); 60 - 61 module_param_string(pal, pal, sizeof(pal), 0644); 62 module_param_string(secam, secam, sizeof(secam), 0644); 63 module_param_string(ntsc, ntsc, sizeof(ntsc), 0644); ··· 419 t->radio_if2 = 10700 * 1000; /* 10.7MHz - FM radio */ 420 t->audmode = V4L2_TUNER_MODE_STEREO; 421 t->mode_mask = T_UNINITIALIZED; 422 - if (tuner_debug) { 423 - debug = tuner_debug; 424 printk(KERN_ERR "tuner: tuner_debug is deprecated and will be removed in 2.6.17.\n"); 425 printk(KERN_ERR "tuner: use the debug option instead.\n"); 426 } ··· 551 { 552 struct tuner *t = i2c_get_clientdata(client); 553 554 - if (debug>1) 555 v4l_i2c_print_ioctl(&(t->i2c),cmd); 556 557 switch (cmd) {
··· 41 static unsigned int show_i2c = 0; 42 43 /* insmod options used at runtime => read/write */ 44 + static unsigned int tuner_debug_old = 0; 45 + int tuner_debug = 0; 46 47 static unsigned int tv_range[2] = { 44, 958 }; 48 static unsigned int radio_range[2] = { 65, 108 }; ··· 51 static char secam[] = "--"; 52 static char ntsc[] = "-"; 53 54 + 55 module_param(addr, int, 0444); 56 module_param(no_autodetect, int, 0444); 57 module_param(show_i2c, int, 0444); 58 /* Note: tuner_debug is deprecated and will be removed in 2.6.17 */ 59 + module_param_named(tuner_debug,tuner_debug_old, int, 0444); 60 + module_param_named(debug,tuner_debug, int, 0644); 61 module_param_string(pal, pal, sizeof(pal), 0644); 62 module_param_string(secam, secam, sizeof(secam), 0644); 63 module_param_string(ntsc, ntsc, sizeof(ntsc), 0644); ··· 419 t->radio_if2 = 10700 * 1000; /* 10.7MHz - FM radio */ 420 t->audmode = V4L2_TUNER_MODE_STEREO; 421 t->mode_mask = T_UNINITIALIZED; 422 + if (tuner_debug_old) { 423 + tuner_debug = tuner_debug_old; 424 printk(KERN_ERR "tuner: tuner_debug is deprecated and will be removed in 2.6.17.\n"); 425 printk(KERN_ERR "tuner: use the debug option instead.\n"); 426 } ··· 551 { 552 struct tuner *t = i2c_get_clientdata(client); 553 554 + if (tuner_debug>1) 555 v4l_i2c_print_ioctl(&(t->i2c),cmd); 556 557 switch (cmd) {
+2 -2
include/media/tuner.h
··· 218 printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ 219 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) 220 #define tuner_dbg(fmt, arg...) do {\ 221 - extern int debug; \ 222 - if (debug) \ 223 printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ 224 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) 225
··· 218 printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ 219 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) 220 #define tuner_dbg(fmt, arg...) do {\ 221 + extern int tuner_debug; \ 222 + if (tuner_debug) \ 223 printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->driver.name, \ 224 i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) 225