Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75d569d3 authored by Venkatraman S's avatar Venkatraman S Committed by Chris Ball
Browse files

mmc: omap: fix mmc_omap_report_irq to use dev_dbg macros



The function mmc_omap_report_irq uses raw printks and the actual output
was disabled by a static variable. Make the function use dev_vdbg macro
and use it under the standard CONFIG_MMC_DEBUG flag.

Signed-off-by: default avatarVenkatraman S <svenkatr@ti.com>
Acked-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 2976837c
Loading
Loading
Loading
Loading
+17 −12
Original line number Original line Diff line number Diff line
@@ -687,22 +687,29 @@ mmc_omap_xfer_data(struct mmc_omap_host *host, int write)
	host->buffer += nwords;
	host->buffer += nwords;
}
}


static inline void mmc_omap_report_irq(u16 status)
#ifdef CONFIG_MMC_DEBUG
static void mmc_omap_report_irq(struct mmc_omap_host *host, u16 status)
{
{
	static const char *mmc_omap_status_bits[] = {
	static const char *mmc_omap_status_bits[] = {
		"EOC", "CD", "CB", "BRS", "EOFB", "DTO", "DCRC", "CTO",
		"EOC", "CD", "CB", "BRS", "EOFB", "DTO", "DCRC", "CTO",
		"CCRC", "CRW", "AF", "AE", "OCRB", "CIRQ", "CERR"
		"CCRC", "CRW", "AF", "AE", "OCRB", "CIRQ", "CERR"
	};
	};
	int i, c = 0;
	int i;
	char res[64], *buf = res;

	buf += sprintf(buf, "MMC IRQ 0x%x:", status);


	for (i = 0; i < ARRAY_SIZE(mmc_omap_status_bits); i++)
	for (i = 0; i < ARRAY_SIZE(mmc_omap_status_bits); i++)
		if (status & (1 << i)) {
		if (status & (1 << i))
			if (c)
			buf += sprintf(buf, " %s", mmc_omap_status_bits[i]);
				printk(" ");
	dev_vdbg(mmc_dev(host->mmc), "%s\n", res);
			printk("%s", mmc_omap_status_bits[i]);
			c++;
}
}
#else
static void mmc_omap_report_irq(struct mmc_omap_host *host, u16 status)
{
}
}
#endif



static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
{
{
@@ -736,12 +743,10 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
			cmd = host->cmd->opcode;
			cmd = host->cmd->opcode;
		else
		else
			cmd = -1;
			cmd = -1;
#ifdef CONFIG_MMC_DEBUG
		dev_dbg(mmc_dev(host->mmc), "MMC IRQ %04x (CMD %d): ",
		dev_dbg(mmc_dev(host->mmc), "MMC IRQ %04x (CMD %d): ",
			status, cmd);
			status, cmd);
		mmc_omap_report_irq(status);
		mmc_omap_report_irq(host, status);
		printk("\n");

#endif
		if (host->total_bytes_left) {
		if (host->total_bytes_left) {
			if ((status & OMAP_MMC_STAT_A_FULL) ||
			if ((status & OMAP_MMC_STAT_A_FULL) ||
			    (status & OMAP_MMC_STAT_END_OF_DATA))
			    (status & OMAP_MMC_STAT_END_OF_DATA))