radeonfb: fix debug option
authorJean Delvare <khali@linux-fr.org>
Mon, 28 Apr 2008 09:15:12 +0000 (02:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Apr 2008 15:58:38 +0000 (08:58 -0700)
Fix CONFIG_FB_RADEON_DEBUG.  DEBUG must be defined before including any kernel
header, otherwise dev_dbg() resolves to a no-op.  Also, when debugging is
disabled, don't set DEBUG at all instead of setting it to 0, to comply with
what the kernel headers expect.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/aty/radeon_base.c
drivers/video/aty/radeon_i2c.c
drivers/video/aty/radeon_monitor.c
drivers/video/aty/radeonfb.h

index 48e60cbc36c5f2ca5cb2bc13b49296f29150fe02..10f32c83c96a6cd162ee91dc3865bee2887f3323 100644 (file)
@@ -52,6 +52,8 @@
 
 #define RADEON_VERSION "0.2.0"
 
+#include "radeonfb.h"
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -92,7 +94,6 @@
 
 #include "../edid.h" // MOVE THAT TO include/video
 #include "ati_ids.h"
-#include "radeonfb.h"              
 
 #define MAX_MAPPED_VRAM        (2048*2048*4)
 #define MIN_MAPPED_VRAM        (1024*768*1)
index 7db9de6817169c40724bc554b580e93b57a6385e..5254c7627a5ab1643b2d6f90dbba41770fc58a24 100644 (file)
@@ -1,3 +1,5 @@
+#include "radeonfb.h"
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
@@ -11,7 +13,6 @@
 #include <asm/io.h>
 
 #include <video/radeon.h>
-#include "radeonfb.h"
 #include "../edid.h"
 
 static void radeon_gpio_setscl(void* data, int state)
index 2030ed813429f802114fff22ff4919aabc858f26..4f756888dcd3fe6b79c79c4ebedf527af44df3b7 100644 (file)
@@ -481,7 +481,7 @@ void __devinit radeon_probe_screens(struct radeonfb_info *rinfo,
                
                RTRACE("Starting monitor auto detection...\n");
 
-#if DEBUG && defined(CONFIG_FB_RADEON_I2C)
+#if defined(DEBUG) && defined(CONFIG_FB_RADEON_I2C)
                {
                        u8 *EDIDs[4] = { NULL, NULL, NULL, NULL };
                        int mon_types[4] = {MT_NONE, MT_NONE, MT_NONE, MT_NONE};
index 5eac1ce52e72001d078248026f501c6efb7082ad..8215ca0555c21631b46f73c87d89838e6a84f206 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef __RADEONFB_H__
 #define __RADEONFB_H__
 
+#ifdef CONFIG_FB_RADEON_DEBUG
+#define DEBUG          1
+#endif
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -367,13 +371,7 @@ struct radeonfb_info {
 /*
  * Debugging stuffs
  */
-#ifdef CONFIG_FB_RADEON_DEBUG
-#define DEBUG          1
-#else
-#define DEBUG          0
-#endif
-
-#if DEBUG
+#ifdef DEBUG
 #define RTRACE         printk
 #else
 #define RTRACE         if(0) printk