Commit c1ea6029 authored by Russell King's avatar Russell King

[MMC] Cleanup: Make MMCI debug macro take host, format and arguments.

parent 9fe3986d
...@@ -31,9 +31,10 @@ ...@@ -31,9 +31,10 @@
#define DRIVER_NAME "mmci-pl18x" #define DRIVER_NAME "mmci-pl18x"
#ifdef CONFIG_MMC_DEBUG #ifdef CONFIG_MMC_DEBUG
#define DBG(x...) pr_debug(x) #define DBG(host,fmt,args...) \
pr_debug("%s: %s: " fmt, host->mmc->host_name, __func__ , args)
#else #else
#define DBG(x...) do { } while (0) #define DBG(host,fmt,args...) do { } while (0)
#endif #endif
static unsigned int fmax = 515633; static unsigned int fmax = 515633;
...@@ -63,9 +64,8 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) ...@@ -63,9 +64,8 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
{ {
unsigned int datactrl, timeout, irqmask; unsigned int datactrl, timeout, irqmask;
DBG("%s: data: blksz %04x blks %04x flags %08x\n", DBG(host, "blksz %04x blks %04x flags %08x\n",
host->mmc->host_name, 1 << data->blksz_bits, data->blocks, 1 << data->blksz_bits, data->blocks, data->flags);
data->flags);
host->data = data; host->data = data;
host->buffer = data->req->buffer; host->buffer = data->req->buffer;
...@@ -98,8 +98,8 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) ...@@ -98,8 +98,8 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
static void static void
mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c) mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c)
{ {
DBG("%s: cmd: op %02x arg %08x flags %08x\n", DBG(host, "op %02x arg %08x flags %08x\n",
host->mmc->host_name, cmd->opcode, cmd->arg, cmd->flags); cmd->opcode, cmd->arg, cmd->flags);
if (readl(host->base + MMCICOMMAND) & MCI_CPSM_ENABLE) { if (readl(host->base + MMCICOMMAND) & MCI_CPSM_ENABLE) {
writel(0, host->base + MMCICOMMAND); writel(0, host->base + MMCICOMMAND);
...@@ -189,7 +189,7 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -189,7 +189,7 @@ static irqreturn_t mmci_pio_irq(int irq, void *dev_id, struct pt_regs *regs)
MCI_TXFIFOEMPTY|MCI_TXFIFOHALFEMPTY))) MCI_TXFIFOEMPTY|MCI_TXFIFOHALFEMPTY)))
break; break;
DBG("%s: irq1 %08x\n", host->mmc->host_name, status); DBG(host, "irq1 %08x\n", status);
if (status & (MCI_RXDATAAVLBL|MCI_RXFIFOHALFFULL)) { if (status & (MCI_RXDATAAVLBL|MCI_RXFIFOHALFFULL)) {
int count = host->size - (readl(host->base + MMCIFIFOCNT) << 2); int count = host->size - (readl(host->base + MMCIFIFOCNT) << 2);
...@@ -260,7 +260,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -260,7 +260,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id, struct pt_regs *regs)
if (!(status & MCI_IRQMASK)) if (!(status & MCI_IRQMASK))
break; break;
DBG("%s: irq0 %08x\n", host->mmc->host_name, status); DBG(host, "irq0 %08x\n", status);
data = host->data; data = host->data;
if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN| if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|
...@@ -302,9 +302,8 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -302,9 +302,8 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
struct mmci_host *host = mmc_priv(mmc); struct mmci_host *host = mmc_priv(mmc);
u32 clk = 0, pwr = 0; u32 clk = 0, pwr = 0;
DBG("%s: set_ios: clock %uHz busmode %u powermode %u Vdd %u\n", DBG(host, "clock %uHz busmode %u powermode %u Vdd %u\n",
mmc->host_name, ios->clock, ios->bus_mode, ios->power_mode, ios->clock, ios->bus_mode, ios->power_mode, ios->vdd);
ios->vdd);
if (ios->clock) { if (ios->clock) {
if (ios->clock >= host->mclk) { if (ios->clock >= host->mclk) {
......
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