Commit ef392885 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] zoran: debug->zr_debug

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.
parent f5ae79e9
...@@ -136,7 +136,8 @@ MODULE_PARM(pass_through, "i"); ...@@ -136,7 +136,8 @@ MODULE_PARM(pass_through, "i");
MODULE_PARM_DESC(pass_through, MODULE_PARM_DESC(pass_through,
"Pass TV signal through to TV-out when idling"); "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(debug, "i");
MODULE_PARM_DESC(debug, "Debug level (0-4)"); MODULE_PARM_DESC(debug, "Debug level (0-4)");
...@@ -153,7 +154,7 @@ MODULE_DEVICE_TABLE(pci, zr36067_pci_tbl); ...@@ -153,7 +154,7 @@ MODULE_DEVICE_TABLE(pci, zr36067_pci_tbl);
#define dprintk(num, format, args...) \ #define dprintk(num, format, args...) \
do { \ do { \
if (debug >= num) \ if (*zr_debug >= num) \
printk(format, ##args); \ printk(format, ##args); \
} while (0) } while (0)
...@@ -977,7 +978,7 @@ test_interrupts (struct zoran *zr) ...@@ -977,7 +978,7 @@ test_interrupts (struct zoran *zr)
if (timeout) { if (timeout) {
dprintk(1, ": time spent: %d\n", 1 * HZ - timeout); dprintk(1, ": time spent: %d\n", 1 * HZ - timeout);
} }
if (debug > 1) if (*zr_debug > 1)
print_interrupts(zr); print_interrupts(zr);
btwrite(icr, ZR36057_ICR); btwrite(icr, ZR36057_ICR);
} }
...@@ -1066,7 +1067,7 @@ zr36057_init (struct zoran *zr) ...@@ -1066,7 +1067,7 @@ zr36057_init (struct zoran *zr)
} }
zoran_init_hardware(zr); zoran_init_hardware(zr);
if (debug > 2) if (*zr_debug > 2)
detect_guest_activity(zr); detect_guest_activity(zr);
test_interrupts(zr); test_interrupts(zr);
if (!pass_through) { if (!pass_through) {
......
...@@ -58,11 +58,11 @@ ...@@ -58,11 +58,11 @@
extern const struct zoran_format zoran_formats[]; extern const struct zoran_format zoran_formats[];
extern const int zoran_num_formats; extern const int zoran_num_formats;
extern int debug; extern int *zr_debug;
#define dprintk(num, format, args...) \ #define dprintk(num, format, args...) \
do { \ do { \
if (debug >= num) \ if (*zr_debug >= num) \
printk(format, ##args); \ printk(format, ##args); \
} while (0) } while (0)
...@@ -170,7 +170,7 @@ post_office_read (struct zoran *zr, ...@@ -170,7 +170,7 @@ post_office_read (struct zoran *zr,
static void static void
dump_guests (struct zoran *zr) dump_guests (struct zoran *zr)
{ {
if (debug > 2) { if (*zr_debug > 2) {
int i, guest[8]; int i, guest[8];
for (i = 1; i < 8; i++) { // Don't read jpeg codec here for (i = 1; i < 8; i++) { // Don't read jpeg codec here
...@@ -1272,7 +1272,7 @@ error_handler (struct zoran *zr, ...@@ -1272,7 +1272,7 @@ error_handler (struct zoran *zr,
zr->num_errors++; zr->num_errors++;
/* Report error */ /* Report error */
if (debug > 1 && zr->num_errors <= 8) { if (*zr_debug > 1 && zr->num_errors <= 8) {
long frame; long frame;
frame = frame =
zr->jpg_pend[zr->jpg_dma_tail & BUZ_MASK_FRAME]; zr->jpg_pend[zr->jpg_dma_tail & BUZ_MASK_FRAME];
...@@ -1544,7 +1544,7 @@ zoran_irq (int irq, ...@@ -1544,7 +1544,7 @@ zoran_irq (int irq,
if (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS || if (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS ||
zr->codec_mode == BUZ_MODE_MOTION_COMPRESS) { zr->codec_mode == BUZ_MODE_MOTION_COMPRESS) {
if (debug > 1 && if (*zr_debug > 1 &&
(!zr->frame_num || zr->JPEG_error)) { (!zr->frame_num || zr->JPEG_error)) {
printk(KERN_INFO printk(KERN_INFO
"%s: first frame ready: state=0x%08x odd_even=%d field_per_buff=%d delay=%d\n", "%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, ...@@ -1584,7 +1584,7 @@ zoran_irq (int irq,
zr->JPEG_missed; zr->JPEG_missed;
} }
if (debug > 2 && zr->frame_num < 6) { if (*zr_debug > 2 && zr->frame_num < 6) {
int i; int i;
printk("%s: seq=%ld stat_com:", printk("%s: seq=%ld stat_com:",
ZR_DEVNAME(zr), zr->jpg_seq_num); ZR_DEVNAME(zr), zr->jpg_seq_num);
......
...@@ -187,11 +187,11 @@ const int zoran_num_formats = ...@@ -187,11 +187,11 @@ const int zoran_num_formats =
# include <linux/bigphysarea.h> # include <linux/bigphysarea.h>
#endif #endif
extern int debug; extern int *zr_debug;
#define dprintk(num, format, args...) \ #define dprintk(num, format, args...) \
do { \ do { \
if (debug >= num) \ if (*zr_debug >= num) \
printk(format, ##args); \ printk(format, ##args); \
} while (0) } while (0)
...@@ -1144,7 +1144,7 @@ jpg_sync (struct file *file, ...@@ -1144,7 +1144,7 @@ jpg_sync (struct file *file,
frame = zr->jpg_pend[zr->jpg_que_tail & BUZ_MASK_FRAME]; frame = zr->jpg_pend[zr->jpg_que_tail & BUZ_MASK_FRAME];
/* buffer should now be in BUZ_STATE_DONE */ /* 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) if (zr->jpg_buffers.buffer[frame].state != BUZ_STATE_DONE)
dprintk(2, dprintk(2,
KERN_ERR KERN_ERR
...@@ -1424,7 +1424,7 @@ zoran_close (struct inode *inode, ...@@ -1424,7 +1424,7 @@ zoran_close (struct inode *inode,
/* disable interrupts */ /* disable interrupts */
btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR); btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR);
if (debug > 1) if (*zr_debug > 1)
print_interrupts(zr); print_interrupts(zr);
/* Overlay off */ /* Overlay off */
......
...@@ -49,11 +49,11 @@ ...@@ -49,11 +49,11 @@
#include "zoran.h" #include "zoran.h"
#include "zoran_procfs.h" #include "zoran_procfs.h"
extern int debug; extern int *zr_debug;
#define dprintk(num, format, args...) \ #define dprintk(num, format, args...) \
do { \ do { \
if (debug >= num) \ if (*zr_debug >= num) \
printk(format, ##args); \ printk(format, ##args); \
} while (0) } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment