Skip to content

Commit f421865

Browse files
ahunter6storulf
authored andcommitted
mmc: sdhci: Improve debug print format
Ensure all debug prints start with the mmc host name. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Ludovic Desroches <ludovic.desroches@microchip.com>
1 parent 2a85ef2 commit f421865

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

drivers/mmc/host/sdhci.c

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#define DRIVER_NAME "sdhci"
3939

4040
#define DBG(f, x...) \
41-
pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x)
41+
pr_debug("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x)
4242

4343
#define MAX_TUNING_LOOP 40
4444

@@ -715,8 +715,8 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd)
715715
}
716716

717717
if (count >= 0xF) {
718-
DBG("%s: Too large timeout 0x%x requested for CMD%d!\n",
719-
mmc_hostname(host->mmc), count, cmd->opcode);
718+
DBG("Too large timeout 0x%x requested for CMD%d!\n",
719+
count, cmd->opcode);
720720
count = 0xE;
721721
}
722722

@@ -2485,7 +2485,6 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask)
24852485
#ifdef CONFIG_MMC_DEBUG
24862486
static void sdhci_adma_show_error(struct sdhci_host *host)
24872487
{
2488-
const char *name = mmc_hostname(host->mmc);
24892488
void *desc = host->adma_table;
24902489

24912490
sdhci_dumpregs(host);
@@ -2494,14 +2493,14 @@ static void sdhci_adma_show_error(struct sdhci_host *host)
24942493
struct sdhci_adma2_64_desc *dma_desc = desc;
24952494

24962495
if (host->flags & SDHCI_USE_64_BIT_DMA)
2497-
DBG("%s: %p: DMA 0x%08x%08x, LEN 0x%04x, Attr=0x%02x\n",
2498-
name, desc, le32_to_cpu(dma_desc->addr_hi),
2496+
DBG("%p: DMA 0x%08x%08x, LEN 0x%04x, Attr=0x%02x\n",
2497+
desc, le32_to_cpu(dma_desc->addr_hi),
24992498
le32_to_cpu(dma_desc->addr_lo),
25002499
le16_to_cpu(dma_desc->len),
25012500
le16_to_cpu(dma_desc->cmd));
25022501
else
2503-
DBG("%s: %p: DMA 0x%08x, LEN 0x%04x, Attr=0x%02x\n",
2504-
name, desc, le32_to_cpu(dma_desc->addr_lo),
2502+
DBG("%p: DMA 0x%08x, LEN 0x%04x, Attr=0x%02x\n",
2503+
desc, le32_to_cpu(dma_desc->addr_lo),
25052504
le16_to_cpu(dma_desc->len),
25062505
le16_to_cpu(dma_desc->cmd));
25072506

@@ -2617,10 +2616,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
26172616
~(SDHCI_DEFAULT_BOUNDARY_SIZE - 1)) +
26182617
SDHCI_DEFAULT_BOUNDARY_SIZE;
26192618
host->data->bytes_xfered = dmanow - dmastart;
2620-
DBG("%s: DMA base 0x%08x, transferred 0x%06x bytes,"
2621-
" next 0x%08x\n",
2622-
mmc_hostname(host->mmc), dmastart,
2623-
host->data->bytes_xfered, dmanow);
2619+
DBG("DMA base 0x%08x, transferred 0x%06x bytes, next 0x%08x\n",
2620+
dmastart, host->data->bytes_xfered, dmanow);
26242621
sdhci_writel(host, dmanow, SDHCI_DMA_ADDRESS);
26252622
}
26262623

@@ -2665,8 +2662,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
26652662
SDHCI_INT_BUS_POWER);
26662663
sdhci_writel(host, mask, SDHCI_INT_STATUS);
26672664

2668-
DBG("*** %s got interrupt: 0x%08x\n",
2669-
mmc_hostname(host->mmc), intmask);
2665+
DBG("IRQ status 0x%08x\n", intmask);
26702666

26712667
if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) {
26722668
u32 present = sdhci_readl(host, SDHCI_PRESENT_STATE) &
@@ -3296,9 +3292,9 @@ int sdhci_setup_host(struct sdhci_host *host)
32963292
!(host->flags & SDHCI_USE_SDMA)) &&
32973293
!(host->quirks2 & SDHCI_QUIRK2_ACMD23_BROKEN)) {
32983294
host->flags |= SDHCI_AUTO_CMD23;
3299-
DBG("%s: Auto-CMD23 available\n", mmc_hostname(mmc));
3295+
DBG("Auto-CMD23 available\n");
33003296
} else {
3301-
DBG("%s: Auto-CMD23 unavailable\n", mmc_hostname(mmc));
3297+
DBG("Auto-CMD23 unavailable\n");
33023298
}
33033299

33043300
/*

0 commit comments

Comments
 (0)