]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[MMC] Pass -DDEBUG on compiler command line if MMC_DEBUG selected
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Wed, 29 Mar 2006 08:30:20 +0000 (09:30 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 29 Mar 2006 08:30:20 +0000 (09:30 +0100)
Rather than each driver test MMC_DEBUG itself, and define DEBUG,
pass it in via the makefile instead.

Fix drivers to use pr_debug() where appropriate, and avoid defining
a DEBUG() macro.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/mmc/Makefile
drivers/mmc/au1xmmc.c
drivers/mmc/mmc.c
drivers/mmc/mmci.c
drivers/mmc/omap.c
drivers/mmc/pxamci.c
drivers/mmc/sdhci.c
drivers/mmc/wbsd.c

index 0b0920ae46b7ca453c73af9a319d55402f1ecc07..c7c34aadfc92c950c94856b622c950c8d715adf8 100644 (file)
@@ -23,3 +23,7 @@ obj-$(CONFIG_MMC_AU1X)                += au1xmmc.o
 obj-$(CONFIG_MMC_OMAP)         += omap.o
 
 mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o
+
+ifeq ($(CONFIG_MMC_DEBUG),y)
+EXTRA_CFLAGS += -DDEBUG
+endif
index 85e89c77bdea23d36d9f9865a47e6e0ff65be6da..c0326bbc5f283d08e36b9d5a49075494a731f83d 100644 (file)
 #define DRIVER_NAME "au1xxx-mmc"
 
 /* Set this to enable special debugging macros */
-/* #define MMC_DEBUG */
 
-#ifdef MMC_DEBUG
-#define DEBUG(fmt, idx, args...) printk("au1xx(%d): DEBUG: " fmt, idx, ##args)
+#ifdef DEBUG
+#define DBG(fmt, idx, args...) printk("au1xx(%d): DEBUG: " fmt, idx, ##args)
 #else
-#define DEBUG(fmt, idx, args...)
+#define DBG(fmt, idx, args...)
 #endif
 
 const struct {
@@ -424,18 +423,18 @@ static void au1xmmc_receive_pio(struct au1xmmc_host *host)
                        break;
 
                if (status & SD_STATUS_RC) {
-                       DEBUG("RX CRC Error [%d + %d].\n", host->id,
+                       DBG("RX CRC Error [%d + %d].\n", host->id,
                                        host->pio.len, count);
                        break;
                }
 
                if (status & SD_STATUS_RO) {
-                       DEBUG("RX Overrun [%d + %d]\n", host->id,
+                       DBG("RX Overrun [%d + %d]\n", host->id,
                                        host->pio.len, count);
                        break;
                }
                else if (status & SD_STATUS_RU) {
-                       DEBUG("RX Underrun [%d + %d]\n", host->id,
+                       DBG("RX Underrun [%d + %d]\n", host->id,
                                        host->pio.len,  count);
                        break;
                }
@@ -721,7 +720,7 @@ static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios)
 {
        struct au1xmmc_host *host = mmc_priv(mmc);
 
-       DEBUG("set_ios (power=%u, clock=%uHz, vdd=%u, mode=%u)\n",
+       DBG("set_ios (power=%u, clock=%uHz, vdd=%u, mode=%u)\n",
              host->id, ios->power_mode, ios->clock, ios->vdd,
              ios->bus_mode);
 
@@ -810,7 +809,7 @@ static irqreturn_t au1xmmc_irq(int irq, void *dev_id, struct pt_regs *regs)
                                au1xmmc_receive_pio(host);
                }
                else if (status & 0x203FBC70) {
-                       DEBUG("Unhandled status %8.8x\n", host->id, status);
+                       DBG("Unhandled status %8.8x\n", host->id, status);
                        handled = 0;
                }
 
@@ -839,7 +838,7 @@ static void au1xmmc_poll_event(unsigned long arg)
 
        if (host->mrq != NULL) {
                u32 status = au_readl(HOST_STATUS(host));
-               DEBUG("PENDING - %8.8x\n", host->id, status);
+               DBG("PENDING - %8.8x\n", host->id, status);
        }
 
        mod_timer(&host->timer, jiffies + AU1XMMC_DETECT_TIMEOUT);
index 1888060c5e0c415cf5701250f845bf4d27a5e0a4..da6ddd910fc513d8ad8552fa575984485899a653 100644 (file)
 
 #include "mmc.h"
 
-#ifdef CONFIG_MMC_DEBUG
-#define DBG(x...)      printk(KERN_DEBUG x)
-#else
-#define DBG(x...)      do { } while (0)
-#endif
-
 #define CMD_RETRIES    3
 
 /*
@@ -77,8 +71,9 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
 {
        struct mmc_command *cmd = mrq->cmd;
        int err = mrq->cmd->error;
-       DBG("MMC: req done (%02x): %d: %08x %08x %08x %08x\n", cmd->opcode,
-           err, cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3]);
+       pr_debug("MMC: req done (%02x): %d: %08x %08x %08x %08x\n",
+                cmd->opcode, err, cmd->resp[0], cmd->resp[1],
+                cmd->resp[2], cmd->resp[3]);
 
        if (err && cmd->retries) {
                cmd->retries--;
@@ -102,8 +97,8 @@ EXPORT_SYMBOL(mmc_request_done);
 void
 mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
 {
-       DBG("MMC: starting cmd %02x arg %08x flags %08x\n",
-           mrq->cmd->opcode, mrq->cmd->arg, mrq->cmd->flags);
+       pr_debug("MMC: starting cmd %02x arg %08x flags %08x\n",
+                mrq->cmd->opcode, mrq->cmd->arg, mrq->cmd->flags);
 
        WARN_ON(host->card_busy == NULL);
 
@@ -976,8 +971,8 @@ static unsigned int mmc_calculate_clock(struct mmc_host *host)
                if (!mmc_card_dead(card) && max_dtr > card->csd.max_dtr)
                        max_dtr = card->csd.max_dtr;
 
-       DBG("MMC: selected %d.%03dMHz transfer rate\n",
-           max_dtr / 1000000, (max_dtr / 1000) % 1000);
+       pr_debug("MMC: selected %d.%03dMHz transfer rate\n",
+                max_dtr / 1000000, (max_dtr / 1000) % 1000);
 
        return max_dtr;
 }
index 9fef29d978b5e676fead18b320f86cbd19c533b4..df7e861e2fc75f2c5cfa5e5196b70b597378ecd9 100644 (file)
 
 #define DRIVER_NAME "mmci-pl18x"
 
-#ifdef CONFIG_MMC_DEBUG
 #define DBG(host,fmt,args...)  \
        pr_debug("%s: %s: " fmt, mmc_hostname(host->mmc), __func__ , args)
-#else
-#define DBG(host,fmt,args...)  do { } while (0)
-#endif
 
 static unsigned int fmax = 515633;
 
index 49fb2ea4b7eeb654c86bc032d591308267307eb9..becb3c68c34d7578043a9a0885705ae4d63c9597 100644 (file)
  */
 
 #include <linux/config.h>
-
-#ifdef CONFIG_MMC_DEBUG
-#define DEBUG  /* for dev_dbg(), pr_debug(), etc */
-#endif
-
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
index c32fad1ce51c88e0f75d9296d49ad17e47daae74..eb9a8826e9b5892c6f6bf7fdb48842ecfe8f6d11 100644 (file)
 
 #include "pxamci.h"
 
-#ifdef CONFIG_MMC_DEBUG
-#define DBG(x...)      printk(KERN_DEBUG x)
-#else
-#define DBG(x...)      do { } while (0)
-#endif
-
 #define DRIVER_NAME    "pxa2xx-mci"
 
 #define NR_SG  1
@@ -206,7 +200,7 @@ static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd,
 
 static void pxamci_finish_request(struct pxamci_host *host, struct mmc_request *mrq)
 {
-       DBG("PXAMCI: request done\n");
+       pr_debug("PXAMCI: request done\n");
        host->mrq = NULL;
        host->cmd = NULL;
        host->data = NULL;
@@ -252,7 +246,7 @@ static int pxamci_cmd_done(struct pxamci_host *host, unsigned int stat)
                        if ((cmd->resp[0] & 0x80000000) == 0)
                                cmd->error = MMC_ERR_BADCRC;
                } else {
-                       DBG("ignoring CRC from command %d - *risky*\n",cmd->opcode);
+                       pr_debug("ignoring CRC from command %d - *risky*\n",cmd->opcode);
                }
 #else
                cmd->error = MMC_ERR_BADCRC;
@@ -317,12 +311,12 @@ static irqreturn_t pxamci_irq(int irq, void *devid, struct pt_regs *regs)
 
        ireg = readl(host->base + MMC_I_REG);
 
-       DBG("PXAMCI: irq %08x\n", ireg);
+       pr_debug("PXAMCI: irq %08x\n", ireg);
 
        if (ireg) {
                unsigned stat = readl(host->base + MMC_STAT);
 
-               DBG("PXAMCI: stat %08x\n", stat);
+               pr_debug("PXAMCI: stat %08x\n", stat);
 
                if (ireg & END_CMD_RES)
                        handled |= pxamci_cmd_done(host, stat);
@@ -376,9 +370,9 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 {
        struct pxamci_host *host = mmc_priv(mmc);
 
-       DBG("pxamci_set_ios: clock %u power %u vdd %u.%02u\n",
-           ios->clock, ios->power_mode, ios->vdd / 100,
-           ios->vdd % 100);
+       pr_debug("pxamci_set_ios: clock %u power %u vdd %u.%02u\n",
+                ios->clock, ios->power_mode, ios->vdd / 100,
+                ios->vdd % 100);
 
        if (ios->clock) {
                unsigned int clk = CLOCKRATE / ios->clock;
@@ -405,8 +399,8 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                        host->cmdat |= CMDAT_INIT;
        }
 
-       DBG("pxamci_set_ios: clkrt = %x cmdat = %x\n",
-           host->clkrt, host->cmdat);
+       pr_debug("pxamci_set_ios: clkrt = %x cmdat = %x\n",
+                host->clkrt, host->cmdat);
 }
 
 static struct mmc_host_ops pxamci_ops = {
index 8b811d94371c38c7666f28c7360d4d5f32e837cd..bdbfca050029a91548bd1d4e59a64ab8bb1705a4 100644 (file)
 
 #define BUGMAIL "<sdhci-devel@list.drzeus.cx>"
 
-#ifdef CONFIG_MMC_DEBUG
 #define DBG(f, x...) \
-       printk(KERN_DEBUG DRIVER_NAME " [%s()]: " f, __func__,## x)
-#else
-#define DBG(f, x...) do { } while (0)
-#endif
+       pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x)
 
 static const struct pci_device_id pci_ids[] __devinitdata = {
        /* handle any SD host controller */
index 3be397d436fab83c9d76f5576eb5bcfda953aeeb..511f7b0b31d21c02c12ad98b717e2ace407d60dd 100644 (file)
 #define DRIVER_NAME "wbsd"
 #define DRIVER_VERSION "1.5"
 
-#ifdef CONFIG_MMC_DEBUG
 #define DBG(x...) \
-       printk(KERN_DEBUG DRIVER_NAME ": " x)
+       pr_debug(DRIVER_NAME ": " x)
 #define DBGF(f, x...) \
-       printk(KERN_DEBUG DRIVER_NAME " [%s()]: " f, __func__ , ##x)
-#else
-#define DBG(x...)      do { } while (0)
-#define DBGF(x...)     do { } while (0)
-#endif
+       pr_debug(DRIVER_NAME " [%s()]: " f, __func__ , ##x)
 
 /*
  * Device resources