diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-03-29 03:30:20 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-03-29 03:30:20 -0500 |
commit | c65631781eb0f2e81865017c1484e9aef76e1b61 (patch) | |
tree | 47bb68ecda4dfeecebbc8186a1d7fd12ec03c0d6 /drivers/mmc | |
parent | 730c9b7e6630f786fcec026fb11d2e6f2c90fdcb (diff) |
[MMC] Pass -DDEBUG on compiler command line if MMC_DEBUG selected
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/Makefile | 4 | ||||
-rw-r--r-- | drivers/mmc/au1xmmc.c | 19 | ||||
-rw-r--r-- | drivers/mmc/mmc.c | 19 | ||||
-rw-r--r-- | drivers/mmc/mmci.c | 4 | ||||
-rw-r--r-- | drivers/mmc/omap.c | 5 | ||||
-rw-r--r-- | drivers/mmc/pxamci.c | 24 | ||||
-rw-r--r-- | drivers/mmc/sdhci.c | 6 | ||||
-rw-r--r-- | drivers/mmc/wbsd.c | 9 |
8 files changed, 32 insertions, 58 deletions
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile index 0b0920ae46b7..c7c34aadfc92 100644 --- a/drivers/mmc/Makefile +++ b/drivers/mmc/Makefile | |||
@@ -23,3 +23,7 @@ obj-$(CONFIG_MMC_AU1X) += au1xmmc.o | |||
23 | obj-$(CONFIG_MMC_OMAP) += omap.o | 23 | obj-$(CONFIG_MMC_OMAP) += omap.o |
24 | 24 | ||
25 | mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o | 25 | mmc_core-y := mmc.o mmc_queue.o mmc_sysfs.o |
26 | |||
27 | ifeq ($(CONFIG_MMC_DEBUG),y) | ||
28 | EXTRA_CFLAGS += -DDEBUG | ||
29 | endif | ||
diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c index 85e89c77bdea..c0326bbc5f28 100644 --- a/drivers/mmc/au1xmmc.c +++ b/drivers/mmc/au1xmmc.c | |||
@@ -56,12 +56,11 @@ | |||
56 | #define DRIVER_NAME "au1xxx-mmc" | 56 | #define DRIVER_NAME "au1xxx-mmc" |
57 | 57 | ||
58 | /* Set this to enable special debugging macros */ | 58 | /* Set this to enable special debugging macros */ |
59 | /* #define MMC_DEBUG */ | ||
60 | 59 | ||
61 | #ifdef MMC_DEBUG | 60 | #ifdef DEBUG |
62 | #define DEBUG(fmt, idx, args...) printk("au1xx(%d): DEBUG: " fmt, idx, ##args) | 61 | #define DBG(fmt, idx, args...) printk("au1xx(%d): DEBUG: " fmt, idx, ##args) |
63 | #else | 62 | #else |
64 | #define DEBUG(fmt, idx, args...) | 63 | #define DBG(fmt, idx, args...) |
65 | #endif | 64 | #endif |
66 | 65 | ||
67 | const struct { | 66 | const struct { |
@@ -424,18 +423,18 @@ static void au1xmmc_receive_pio(struct au1xmmc_host *host) | |||
424 | break; | 423 | break; |
425 | 424 | ||
426 | if (status & SD_STATUS_RC) { | 425 | if (status & SD_STATUS_RC) { |
427 | DEBUG("RX CRC Error [%d + %d].\n", host->id, | 426 | DBG("RX CRC Error [%d + %d].\n", host->id, |
428 | host->pio.len, count); | 427 | host->pio.len, count); |
429 | break; | 428 | break; |
430 | } | 429 | } |
431 | 430 | ||
432 | if (status & SD_STATUS_RO) { | 431 | if (status & SD_STATUS_RO) { |
433 | DEBUG("RX Overrun [%d + %d]\n", host->id, | 432 | DBG("RX Overrun [%d + %d]\n", host->id, |
434 | host->pio.len, count); | 433 | host->pio.len, count); |
435 | break; | 434 | break; |
436 | } | 435 | } |
437 | else if (status & SD_STATUS_RU) { | 436 | else if (status & SD_STATUS_RU) { |
438 | DEBUG("RX Underrun [%d + %d]\n", host->id, | 437 | DBG("RX Underrun [%d + %d]\n", host->id, |
439 | host->pio.len, count); | 438 | host->pio.len, count); |
440 | break; | 439 | break; |
441 | } | 440 | } |
@@ -721,7 +720,7 @@ static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios) | |||
721 | { | 720 | { |
722 | struct au1xmmc_host *host = mmc_priv(mmc); | 721 | struct au1xmmc_host *host = mmc_priv(mmc); |
723 | 722 | ||
724 | DEBUG("set_ios (power=%u, clock=%uHz, vdd=%u, mode=%u)\n", | 723 | DBG("set_ios (power=%u, clock=%uHz, vdd=%u, mode=%u)\n", |
725 | host->id, ios->power_mode, ios->clock, ios->vdd, | 724 | host->id, ios->power_mode, ios->clock, ios->vdd, |
726 | ios->bus_mode); | 725 | ios->bus_mode); |
727 | 726 | ||
@@ -810,7 +809,7 @@ static irqreturn_t au1xmmc_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
810 | au1xmmc_receive_pio(host); | 809 | au1xmmc_receive_pio(host); |
811 | } | 810 | } |
812 | else if (status & 0x203FBC70) { | 811 | else if (status & 0x203FBC70) { |
813 | DEBUG("Unhandled status %8.8x\n", host->id, status); | 812 | DBG("Unhandled status %8.8x\n", host->id, status); |
814 | handled = 0; | 813 | handled = 0; |
815 | } | 814 | } |
816 | 815 | ||
@@ -839,7 +838,7 @@ static void au1xmmc_poll_event(unsigned long arg) | |||
839 | 838 | ||
840 | if (host->mrq != NULL) { | 839 | if (host->mrq != NULL) { |
841 | u32 status = au_readl(HOST_STATUS(host)); | 840 | u32 status = au_readl(HOST_STATUS(host)); |
842 | DEBUG("PENDING - %8.8x\n", host->id, status); | 841 | DBG("PENDING - %8.8x\n", host->id, status); |
843 | } | 842 | } |
844 | 843 | ||
845 | mod_timer(&host->timer, jiffies + AU1XMMC_DETECT_TIMEOUT); | 844 | mod_timer(&host->timer, jiffies + AU1XMMC_DETECT_TIMEOUT); |
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 1888060c5e0c..da6ddd910fc5 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c | |||
@@ -27,12 +27,6 @@ | |||
27 | 27 | ||
28 | #include "mmc.h" | 28 | #include "mmc.h" |
29 | 29 | ||
30 | #ifdef CONFIG_MMC_DEBUG | ||
31 | #define DBG(x...) printk(KERN_DEBUG x) | ||
32 | #else | ||
33 | #define DBG(x...) do { } while (0) | ||
34 | #endif | ||
35 | |||
36 | #define CMD_RETRIES 3 | 30 | #define CMD_RETRIES 3 |
37 | 31 | ||
38 | /* | 32 | /* |
@@ -77,8 +71,9 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq) | |||
77 | { | 71 | { |
78 | struct mmc_command *cmd = mrq->cmd; | 72 | struct mmc_command *cmd = mrq->cmd; |
79 | int err = mrq->cmd->error; | 73 | int err = mrq->cmd->error; |
80 | DBG("MMC: req done (%02x): %d: %08x %08x %08x %08x\n", cmd->opcode, | 74 | pr_debug("MMC: req done (%02x): %d: %08x %08x %08x %08x\n", |
81 | err, cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3]); | 75 | cmd->opcode, err, cmd->resp[0], cmd->resp[1], |
76 | cmd->resp[2], cmd->resp[3]); | ||
82 | 77 | ||
83 | if (err && cmd->retries) { | 78 | if (err && cmd->retries) { |
84 | cmd->retries--; | 79 | cmd->retries--; |
@@ -102,8 +97,8 @@ EXPORT_SYMBOL(mmc_request_done); | |||
102 | void | 97 | void |
103 | mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) | 98 | mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) |
104 | { | 99 | { |
105 | DBG("MMC: starting cmd %02x arg %08x flags %08x\n", | 100 | pr_debug("MMC: starting cmd %02x arg %08x flags %08x\n", |
106 | mrq->cmd->opcode, mrq->cmd->arg, mrq->cmd->flags); | 101 | mrq->cmd->opcode, mrq->cmd->arg, mrq->cmd->flags); |
107 | 102 | ||
108 | WARN_ON(host->card_busy == NULL); | 103 | WARN_ON(host->card_busy == NULL); |
109 | 104 | ||
@@ -976,8 +971,8 @@ static unsigned int mmc_calculate_clock(struct mmc_host *host) | |||
976 | if (!mmc_card_dead(card) && max_dtr > card->csd.max_dtr) | 971 | if (!mmc_card_dead(card) && max_dtr > card->csd.max_dtr) |
977 | max_dtr = card->csd.max_dtr; | 972 | max_dtr = card->csd.max_dtr; |
978 | 973 | ||
979 | DBG("MMC: selected %d.%03dMHz transfer rate\n", | 974 | pr_debug("MMC: selected %d.%03dMHz transfer rate\n", |
980 | max_dtr / 1000000, (max_dtr / 1000) % 1000); | 975 | max_dtr / 1000000, (max_dtr / 1000) % 1000); |
981 | 976 | ||
982 | return max_dtr; | 977 | return max_dtr; |
983 | } | 978 | } |
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c index 9fef29d978b5..df7e861e2fc7 100644 --- a/drivers/mmc/mmci.c +++ b/drivers/mmc/mmci.c | |||
@@ -33,12 +33,8 @@ | |||
33 | 33 | ||
34 | #define DRIVER_NAME "mmci-pl18x" | 34 | #define DRIVER_NAME "mmci-pl18x" |
35 | 35 | ||
36 | #ifdef CONFIG_MMC_DEBUG | ||
37 | #define DBG(host,fmt,args...) \ | 36 | #define DBG(host,fmt,args...) \ |
38 | pr_debug("%s: %s: " fmt, mmc_hostname(host->mmc), __func__ , args) | 37 | pr_debug("%s: %s: " fmt, mmc_hostname(host->mmc), __func__ , args) |
39 | #else | ||
40 | #define DBG(host,fmt,args...) do { } while (0) | ||
41 | #endif | ||
42 | 38 | ||
43 | static unsigned int fmax = 515633; | 39 | static unsigned int fmax = 515633; |
44 | 40 | ||
diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c index 49fb2ea4b7ee..becb3c68c34d 100644 --- a/drivers/mmc/omap.c +++ b/drivers/mmc/omap.c | |||
@@ -12,11 +12,6 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <linux/config.h> |
15 | |||
16 | #ifdef CONFIG_MMC_DEBUG | ||
17 | #define DEBUG /* for dev_dbg(), pr_debug(), etc */ | ||
18 | #endif | ||
19 | |||
20 | #include <linux/module.h> | 15 | #include <linux/module.h> |
21 | #include <linux/moduleparam.h> | 16 | #include <linux/moduleparam.h> |
22 | #include <linux/init.h> | 17 | #include <linux/init.h> |
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c index c32fad1ce51c..eb9a8826e9b5 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c | |||
@@ -37,12 +37,6 @@ | |||
37 | 37 | ||
38 | #include "pxamci.h" | 38 | #include "pxamci.h" |
39 | 39 | ||
40 | #ifdef CONFIG_MMC_DEBUG | ||
41 | #define DBG(x...) printk(KERN_DEBUG x) | ||
42 | #else | ||
43 | #define DBG(x...) do { } while (0) | ||
44 | #endif | ||
45 | |||
46 | #define DRIVER_NAME "pxa2xx-mci" | 40 | #define DRIVER_NAME "pxa2xx-mci" |
47 | 41 | ||
48 | #define NR_SG 1 | 42 | #define NR_SG 1 |
@@ -206,7 +200,7 @@ static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd, | |||
206 | 200 | ||
207 | static void pxamci_finish_request(struct pxamci_host *host, struct mmc_request *mrq) | 201 | static void pxamci_finish_request(struct pxamci_host *host, struct mmc_request *mrq) |
208 | { | 202 | { |
209 | DBG("PXAMCI: request done\n"); | 203 | pr_debug("PXAMCI: request done\n"); |
210 | host->mrq = NULL; | 204 | host->mrq = NULL; |
211 | host->cmd = NULL; | 205 | host->cmd = NULL; |
212 | host->data = NULL; | 206 | host->data = NULL; |
@@ -252,7 +246,7 @@ static int pxamci_cmd_done(struct pxamci_host *host, unsigned int stat) | |||
252 | if ((cmd->resp[0] & 0x80000000) == 0) | 246 | if ((cmd->resp[0] & 0x80000000) == 0) |
253 | cmd->error = MMC_ERR_BADCRC; | 247 | cmd->error = MMC_ERR_BADCRC; |
254 | } else { | 248 | } else { |
255 | DBG("ignoring CRC from command %d - *risky*\n",cmd->opcode); | 249 | pr_debug("ignoring CRC from command %d - *risky*\n",cmd->opcode); |
256 | } | 250 | } |
257 | #else | 251 | #else |
258 | cmd->error = MMC_ERR_BADCRC; | 252 | cmd->error = MMC_ERR_BADCRC; |
@@ -317,12 +311,12 @@ static irqreturn_t pxamci_irq(int irq, void *devid, struct pt_regs *regs) | |||
317 | 311 | ||
318 | ireg = readl(host->base + MMC_I_REG); | 312 | ireg = readl(host->base + MMC_I_REG); |
319 | 313 | ||
320 | DBG("PXAMCI: irq %08x\n", ireg); | 314 | pr_debug("PXAMCI: irq %08x\n", ireg); |
321 | 315 | ||
322 | if (ireg) { | 316 | if (ireg) { |
323 | unsigned stat = readl(host->base + MMC_STAT); | 317 | unsigned stat = readl(host->base + MMC_STAT); |
324 | 318 | ||
325 | DBG("PXAMCI: stat %08x\n", stat); | 319 | pr_debug("PXAMCI: stat %08x\n", stat); |
326 | 320 | ||
327 | if (ireg & END_CMD_RES) | 321 | if (ireg & END_CMD_RES) |
328 | handled |= pxamci_cmd_done(host, stat); | 322 | handled |= pxamci_cmd_done(host, stat); |
@@ -376,9 +370,9 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
376 | { | 370 | { |
377 | struct pxamci_host *host = mmc_priv(mmc); | 371 | struct pxamci_host *host = mmc_priv(mmc); |
378 | 372 | ||
379 | DBG("pxamci_set_ios: clock %u power %u vdd %u.%02u\n", | 373 | pr_debug("pxamci_set_ios: clock %u power %u vdd %u.%02u\n", |
380 | ios->clock, ios->power_mode, ios->vdd / 100, | 374 | ios->clock, ios->power_mode, ios->vdd / 100, |
381 | ios->vdd % 100); | 375 | ios->vdd % 100); |
382 | 376 | ||
383 | if (ios->clock) { | 377 | if (ios->clock) { |
384 | unsigned int clk = CLOCKRATE / ios->clock; | 378 | unsigned int clk = CLOCKRATE / ios->clock; |
@@ -405,8 +399,8 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
405 | host->cmdat |= CMDAT_INIT; | 399 | host->cmdat |= CMDAT_INIT; |
406 | } | 400 | } |
407 | 401 | ||
408 | DBG("pxamci_set_ios: clkrt = %x cmdat = %x\n", | 402 | pr_debug("pxamci_set_ios: clkrt = %x cmdat = %x\n", |
409 | host->clkrt, host->cmdat); | 403 | host->clkrt, host->cmdat); |
410 | } | 404 | } |
411 | 405 | ||
412 | static struct mmc_host_ops pxamci_ops = { | 406 | static struct mmc_host_ops pxamci_ops = { |
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 8b811d94371c..bdbfca050029 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c | |||
@@ -31,12 +31,8 @@ | |||
31 | 31 | ||
32 | #define BUGMAIL "<sdhci-devel@list.drzeus.cx>" | 32 | #define BUGMAIL "<sdhci-devel@list.drzeus.cx>" |
33 | 33 | ||
34 | #ifdef CONFIG_MMC_DEBUG | ||
35 | #define DBG(f, x...) \ | 34 | #define DBG(f, x...) \ |
36 | printk(KERN_DEBUG DRIVER_NAME " [%s()]: " f, __func__,## x) | 35 | pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x) |
37 | #else | ||
38 | #define DBG(f, x...) do { } while (0) | ||
39 | #endif | ||
40 | 36 | ||
41 | static const struct pci_device_id pci_ids[] __devinitdata = { | 37 | static const struct pci_device_id pci_ids[] __devinitdata = { |
42 | /* handle any SD host controller */ | 38 | /* handle any SD host controller */ |
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 3be397d436fa..511f7b0b31d2 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c | |||
@@ -44,15 +44,10 @@ | |||
44 | #define DRIVER_NAME "wbsd" | 44 | #define DRIVER_NAME "wbsd" |
45 | #define DRIVER_VERSION "1.5" | 45 | #define DRIVER_VERSION "1.5" |
46 | 46 | ||
47 | #ifdef CONFIG_MMC_DEBUG | ||
48 | #define DBG(x...) \ | 47 | #define DBG(x...) \ |
49 | printk(KERN_DEBUG DRIVER_NAME ": " x) | 48 | pr_debug(DRIVER_NAME ": " x) |
50 | #define DBGF(f, x...) \ | 49 | #define DBGF(f, x...) \ |
51 | printk(KERN_DEBUG DRIVER_NAME " [%s()]: " f, __func__ , ##x) | 50 | pr_debug(DRIVER_NAME " [%s()]: " f, __func__ , ##x) |
52 | #else | ||
53 | #define DBG(x...) do { } while (0) | ||
54 | #define DBGF(x...) do { } while (0) | ||
55 | #endif | ||
56 | 51 | ||
57 | /* | 52 | /* |
58 | * Device resources | 53 | * Device resources |