[U-Boot] [PATCH 09/10] mmc: fix mmcinfo command

Ilya Yanok yanok at emcraft.com
Wed May 6 20:30:32 CEST 2009


cid field of stuct mmc stucture is char*, not u32*. so we need to
convert the pointer for mmcinfo code to work correctly.

Signed-off-by: Ilya Yanok <yanok at emcraft.com>
---
 common/cmd_mmc.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index f1fa32f..21b7004 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -95,12 +95,13 @@ U_BOOT_CMD(
 
 static void print_mmcinfo(struct mmc *mmc)
 {
+	u32 *cid = mmc->cid;
 	printf("Device: %s\n", mmc->name);
-	printf("Manufacturer ID: %x\n", mmc->cid[0] >> 24);
-	printf("OEM: %x\n", (mmc->cid[0] >> 8) & 0xffff);
-	printf("Name: %c%c%c%c%c \n", mmc->cid[0] & 0xff,
-			(mmc->cid[1] >> 24), (mmc->cid[1] >> 16) & 0xff,
-			(mmc->cid[1] >> 8) & 0xff, mmc->cid[1] & 0xff);
+	printf("Manufacturer ID: %x\n", cid[0] >> 24);
+	printf("OEM: %x\n", (cid[0] >> 8) & 0xffff);
+	printf("Name: %c%c%c%c%c \n", cid[0] & 0xff,
+			(cid[1] >> 24), (cid[1] >> 16) & 0xff,
+			(cid[1] >> 8) & 0xff, cid[1] & 0xff);
 
 	printf("Tran Speed: %d\n", mmc->tran_speed);
 	printf("Rd Block Len: %d\n", mmc->read_bl_len);
-- 
1.6.0.6



More information about the U-Boot mailing list