From: Ronald Bultje <rbultje@ronald.bitfreak.net>

This patch renames the debug symbol to zr_debug because debug is already
defined somewhere else. Without it, it will cause a symbol conflict when
compiling this driver statically into the kernel. This was noticed by
several people, including Linus himself.



 drivers/media/video/zoran_card.c   |    9 +++++----
 drivers/media/video/zoran_device.c |   12 ++++++------
 drivers/media/video/zoran_driver.c |    8 ++++----
 drivers/media/video/zoran_procfs.c |    4 ++--
 4 files changed, 17 insertions(+), 16 deletions(-)

diff -puN drivers/media/video/zoran_card.c~zoran-rename-debug drivers/media/video/zoran_card.c
--- 25/drivers/media/video/zoran_card.c~zoran-rename-debug	2003-08-24 02:07:57.000000000 -0700
+++ 25-akpm/drivers/media/video/zoran_card.c	2003-08-24 02:07:57.000000000 -0700
@@ -136,7 +136,8 @@ MODULE_PARM(pass_through, "i");
 MODULE_PARM_DESC(pass_through,
 		 "Pass TV signal through to TV-out when idling");
 
-int debug = 1;
+static int debug = 1;
+int *zr_debug = &debug;
 MODULE_PARM(debug, "i");
 MODULE_PARM_DESC(debug, "Debug level (0-4)");
 
@@ -153,7 +154,7 @@ MODULE_DEVICE_TABLE(pci, zr36067_pci_tbl
 
 #define dprintk(num, format, args...) \
 	do { \
-		if (debug >= num) \
+		if (*zr_debug >= num) \
 			printk(format, ##args); \
 	} while (0)
 
@@ -977,7 +978,7 @@ test_interrupts (struct zoran *zr)
 	if (timeout) {
 		dprintk(1, ": time spent: %d\n", 1 * HZ - timeout);
 	}
-	if (debug > 1)
+	if (*zr_debug > 1)
 		print_interrupts(zr);
 	btwrite(icr, ZR36057_ICR);
 }
@@ -1066,7 +1067,7 @@ zr36057_init (struct zoran *zr)
 	}
 
 	zoran_init_hardware(zr);
-	if (debug > 2)
+	if (*zr_debug > 2)
 		detect_guest_activity(zr);
 	test_interrupts(zr);
 	if (!pass_through) {
diff -puN drivers/media/video/zoran_device.c~zoran-rename-debug drivers/media/video/zoran_device.c
--- 25/drivers/media/video/zoran_device.c~zoran-rename-debug	2003-08-24 02:07:57.000000000 -0700
+++ 25-akpm/drivers/media/video/zoran_device.c	2003-08-24 02:07:57.000000000 -0700
@@ -58,11 +58,11 @@
 extern const struct zoran_format zoran_formats[];
 extern const int zoran_num_formats;
 
-extern int debug;
+extern int *zr_debug;
 
 #define dprintk(num, format, args...) \
 	do { \
-		if (debug >= num) \
+		if (*zr_debug >= num) \
 			printk(format, ##args); \
 	} while (0)
 
@@ -170,7 +170,7 @@ post_office_read (struct zoran *zr,
 static void
 dump_guests (struct zoran *zr)
 {
-	if (debug > 2) {
+	if (*zr_debug > 2) {
 		int i, guest[8];
 
 		for (i = 1; i < 8; i++) {	// Don't read jpeg codec here
@@ -1272,7 +1272,7 @@ error_handler (struct zoran *zr,
 		zr->num_errors++;
 
 		/* Report error */
-		if (debug > 1 && zr->num_errors <= 8) {
+		if (*zr_debug > 1 && zr->num_errors <= 8) {
 			long frame;
 			frame =
 			    zr->jpg_pend[zr->jpg_dma_tail & BUZ_MASK_FRAME];
@@ -1544,7 +1544,7 @@ zoran_irq (int             irq,
 
 			if (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS ||
 			    zr->codec_mode == BUZ_MODE_MOTION_COMPRESS) {
-				if (debug > 1 &&
+				if (*zr_debug > 1 &&
 				    (!zr->frame_num || zr->JPEG_error)) {
 					printk(KERN_INFO
 					       "%s: first frame ready: state=0x%08x odd_even=%d field_per_buff=%d delay=%d\n",
@@ -1584,7 +1584,7 @@ zoran_irq (int             irq,
 						    zr->JPEG_missed;
 				}
 
-				if (debug > 2 && zr->frame_num < 6) {
+				if (*zr_debug > 2 && zr->frame_num < 6) {
 					int i;
 					printk("%s: seq=%ld stat_com:",
 					       ZR_DEVNAME(zr), zr->jpg_seq_num);
diff -puN drivers/media/video/zoran_driver.c~zoran-rename-debug drivers/media/video/zoran_driver.c
--- 25/drivers/media/video/zoran_driver.c~zoran-rename-debug	2003-08-24 02:07:57.000000000 -0700
+++ 25-akpm/drivers/media/video/zoran_driver.c	2003-08-24 02:07:57.000000000 -0700
@@ -187,11 +187,11 @@ const int zoran_num_formats =
 #   include <linux/bigphysarea.h>
 #endif
 
-extern int debug;
+extern int *zr_debug;
 
 #define dprintk(num, format, args...) \
 	do { \
-		if (debug >= num) \
+		if (*zr_debug >= num) \
 			printk(format, ##args);	\
 	} while (0)
 
@@ -1144,7 +1144,7 @@ jpg_sync (struct file       *file,
 		frame = zr->jpg_pend[zr->jpg_que_tail & BUZ_MASK_FRAME];
 
 	/* buffer should now be in BUZ_STATE_DONE */
-	if (debug > 0)
+	if (*zr_debug > 0)
 		if (zr->jpg_buffers.buffer[frame].state != BUZ_STATE_DONE)
 			dprintk(2,
 				KERN_ERR
@@ -1424,7 +1424,7 @@ zoran_close (struct inode *inode,
 		/* disable interrupts */
 		btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR);
 
-		if (debug > 1)
+		if (*zr_debug > 1)
 			print_interrupts(zr);
 
 		/* Overlay off */
diff -puN drivers/media/video/zoran_procfs.c~zoran-rename-debug drivers/media/video/zoran_procfs.c
--- 25/drivers/media/video/zoran_procfs.c~zoran-rename-debug	2003-08-24 02:07:57.000000000 -0700
+++ 25-akpm/drivers/media/video/zoran_procfs.c	2003-08-24 02:07:57.000000000 -0700
@@ -49,11 +49,11 @@
 #include "zoran.h"
 #include "zoran_procfs.h"
 
-extern int debug;
+extern int *zr_debug;
 
 #define dprintk(num, format, args...) \
 	do { \
-		if (debug >= num) \
+		if (*zr_debug >= num) \
 			printk(format, ##args); \
 	} while (0)
 

_