[PATCH 11/15] mmc: bcm2835: Add leading zero to register dumps

Stefan Wahren stefan.wahren at i2se.com
Tue Feb 7 12:45:50 PST 2017


This patch adds the leading zero to register dumps if there is
enough space in order to make them easier to compare.

Signed-off-by: Stefan Wahren <stefan.wahren at i2se.com>
---
 drivers/mmc/host/bcm2835.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index 21aecaf..f926a76 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -444,14 +444,14 @@ static void bcm2835_transfer_block_pio(struct bcm2835_host *host, bool is_read)
 				      fsm_state != SDEDM_FSM_WRITESTART1 &&
 				      fsm_state != SDEDM_FSM_WRITESTART2))) {
 					hsts = readl(host->ioaddr + SDHSTS);
-					dev_err(dev, "fsm %x, hsts %x\n",
+					dev_err(dev, "fsm %x, hsts %08x\n",
 						fsm_state, hsts);
 					if (hsts & SDHSTS_ERROR_MASK)
 						break;
 				}
 
 				if (time_after(jiffies, wait_max)) {
-					dev_err(dev, "PIO %s timeout - EDM %x\n",
+					dev_err(dev, "PIO %s timeout - EDM %08x\n",
 						is_read ? "read" : "write",
 						edm);
 					hsts = SDHSTS_REW_TIME_OUT;
@@ -497,12 +497,12 @@ static void bcm2835_transfer_pio(struct bcm2835_host *host)
 	if (sdhsts & (SDHSTS_CRC16_ERROR |
 		      SDHSTS_CRC7_ERROR |
 		      SDHSTS_FIFO_ERROR)) {
-		dev_err(dev, "%s transfer error - HSTS %x\n",
+		dev_err(dev, "%s transfer error - HSTS %08x\n",
 			is_read ? "read" : "write", sdhsts);
 		host->data->error = -EILSEQ;
 	} else if ((sdhsts & (SDHSTS_CMD_TIME_OUT |
 			      SDHSTS_REW_TIME_OUT))) {
-		dev_err(dev, "%s timeout error - HSTS %x\n",
+		dev_err(dev, "%s timeout error - HSTS %08x\n",
 			is_read ? "read" : "write", sdhsts);
 		host->data->error = -ETIMEDOUT;
 	}
@@ -779,7 +779,7 @@ static void bcm2835_finish_data(struct bcm2835_host *host)
 		 * command completed. Make sure we do
 		 * things in the proper order.
 		 */
-		dev_dbg(dev, "Finished early - HSTS %x\n",
+		dev_dbg(dev, "Finished early - HSTS %08x\n",
 			readl(host->ioaddr + SDHSTS));
 	} else {
 		bcm2835_transfer_complete(host);
@@ -792,7 +792,7 @@ static void bcm2835_finish_command(struct bcm2835_host *host)
 	struct mmc_command *cmd = host->cmd;
 	u32 sdcmd;
 
-	dev_dbg(dev, "finish_command(%x)\n", readl(host->ioaddr + SDCMD));
+	dev_dbg(dev, "finish_command(%08x)\n", readl(host->ioaddr + SDCMD));
 
 	sdcmd = bcm2835_read_wait_sdcmd(host, 100, true);
 
@@ -908,7 +908,7 @@ static bool bcm2835_check_cmd_error(struct bcm2835_host *host, u32 intmask)
 	if (!host->cmd)
 		return true;
 
-	dev_err(dev, "sdhost_busy_irq: intmask %x\n", intmask);
+	dev_err(dev, "sdhost_busy_irq: intmask %08x\n", intmask);
 	if (intmask & SDHSTS_CRC7_ERROR) {
 		host->cmd->error = -EILSEQ;
 	} else if (intmask & (SDHSTS_CRC16_ERROR |
@@ -1190,7 +1190,7 @@ static void bcm2835_request(struct mmc_host *mmc, struct mmc_request *mrq)
 
 	if ((fsm != SDEDM_FSM_IDENTMODE) &&
 	    (fsm != SDEDM_FSM_DATAMODE)) {
-		dev_err(dev, "previous command (%d) not complete (EDM %x)\n",
+		dev_err(dev, "previous command (%d) not complete (EDM %08x)\n",
 			readl(host->ioaddr + SDCMD) & SDCMD_CMD_MASK,
 			edm);
 		bcm2835_dumpregs(host);
-- 
1.7.9.5




More information about the linux-rpi-kernel mailing list