From 21e61b2c212edb8d0c30ed8098b04dd1b74bb000 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 11 Oct 2008 08:47:28 -0300 Subject: af9013/m5602: Fix compilation at in-kernel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mauro Carvalho Chehab This patch fixes a few errors that were breaking in-kernel compilation. The first one were at m5602 that were including "gspca.h" from another directory. A trivial change at m5602/Makefile fixed the issue. A harder to fix error were caused by the fact that both af9013 and m5602 were declaring an external var called 'debug'. If you compile both modules in-kernel, you'll have troubles. This is even worse, since there are two other drivers outside the subsystem with a similar mistake. To make things worse, gcc do a very great job of fooling the developers, by blaming the wrong lines anf files when such error occurs. So, I was having errors like: drivers/media/dvb/built-in.o: In function `dvb_usercopy': /home/v4l/tokernel/git/drivers/media/dvb/dvb-core/dvbdev.c:403: multiple definition of `debug' drivers/media/video/built-in.o:/home/v4l/tokernel/git/drivers/media/video/bt819.c:264: first defined here or: drivers/media/dvb/built-in.o: In function `dvb_usercopy': /home/v4l/tokernel/git/drivers/media/dvb/dvb-core/dvbdev.c:403: multiple definition of `debug' drivers/media/video/built-in.o:/home/v4l/tokernel/git/drivers/media/video/vpx3220.c:125: first defined here The two above errors caused by m5602 driver. After fixing m5602, I got this: drivers/built-in.o: In function `SiS_SetGroup2': /home/v4l/tokernel/git/drivers/video/sis/init301.c:6996: multiple definition of `debug' arch/x86/kernel/built-in.o:/home/v4l/tokernel/git/arch/x86/kernel/entry_32.S:810: first defined here This one caused by af9013. This patch fixes those erros by prefixing the debug vars with the name of the module, without changing the name of the parameter. Next time, please prepend all extern vars with the name of the module. To avoid bisect troubles, I've folded those changes with the original commits that added those modules at my -git tree. kernel-sync: CC: Jean-Francois Moine CC: Antti Palosaari CC: Erik Andrén Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/Makefile | 2 +- linux/drivers/media/dvb/frontends/af9013.c | 4 ++-- linux/drivers/media/dvb/frontends/af9013_priv.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'linux/drivers/media/dvb') diff --git a/linux/drivers/media/dvb/Makefile b/linux/drivers/media/dvb/Makefile index ea953a03e..f91e9eb15 100644 --- a/linux/drivers/media/dvb/Makefile +++ b/linux/drivers/media/dvb/Makefile @@ -2,4 +2,4 @@ # Makefile for the kernel multimedia device drivers. # -obj-y := dvb-core/ frontends/ ttpci/ ttusb-dec/ ttusb-budget/ b2c2/ bt8xx/ cinergyT2/ dvb-usb/ pluto2/ siano/ dm1105/ +obj-y := dvb-core/ frontends/ ttpci/ ttusb-dec/ ttusb-budget/ b2c2/ bt8xx/ dvb-usb/ pluto2/ siano/ dm1105/ diff --git a/linux/drivers/media/dvb/frontends/af9013.c b/linux/drivers/media/dvb/frontends/af9013.c index 739d885b3..50e1e3f30 100644 --- a/linux/drivers/media/dvb/frontends/af9013.c +++ b/linux/drivers/media/dvb/frontends/af9013.c @@ -34,7 +34,7 @@ #include "af9013_priv.h" #include "af9013.h" -int debug; +int af9013_debug; struct af9013_state { struct i2c_adapter *i2c; @@ -1679,7 +1679,7 @@ static struct dvb_frontend_ops af9013_ops = { .read_ucblocks = af9013_read_ucblocks, }; -module_param(debug, int, 0644); +module_param_named(debug, af9013_debug, int, 0644); MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); MODULE_AUTHOR("Antti Palosaari "); diff --git a/linux/drivers/media/dvb/frontends/af9013_priv.h b/linux/drivers/media/dvb/frontends/af9013_priv.h index b62e4cc9b..163e251d0 100644 --- a/linux/drivers/media/dvb/frontends/af9013_priv.h +++ b/linux/drivers/media/dvb/frontends/af9013_priv.h @@ -25,7 +25,7 @@ #define _AF9013_PRIV_ #define LOG_PREFIX "af9013" -extern int debug; +extern int af9013_debug; #define dprintk(var, level, args...) \ do { if ((var & level)) printk(args); } while (0) @@ -37,7 +37,7 @@ extern int debug; func("\n");\ } -#define deb_info(args...) dprintk(debug, 0x01, args) +#define deb_info(args...) dprintk(af9013_debug, 0x01, args) #undef err #define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) -- cgit v1.2.3