Skip to contentSkip to conversation

mmc: core: Change the enhanced area sysfs output format

PATCH New Yunpeng Gao 1 participant 1 message Aug 18, 2014 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: core: Change the enhanced area sysfs output format

From: "Zhang, YiX X" <[email protected]>

Current sysfs output format for eMMC Enhanced Area feature are incorrect.

If the enhanced area feature not enabled, then the driver will return error code -EINVAL(-22) as the sysfs value.

But the definition for those two sysfs items are
unsigned int and unsigned long long.

So, if Enhanced area feature not enabled on the eMMC device, then output similar to below may be observed:
...

	#cat /sys/block/mmcblk0/device/enhanced_area_offset
	#18446744073709551594
	#cat /sys/block/mmcblk0/device/enhanced_area_size
	#4294967274

Submit this patch to change the output format to display the correct value.

---
 drivers/mmc/core/mmc.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/mmc/core/mmc.c +3 -2
index 793c6f7..a57827a 100644
@@ -705,9 +705,10 @@ MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name);
 MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);
 MMC_DEV_ATTR(prv, "0x%x\n", card->cid.prv);
 MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial);
-MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
+MMC_DEV_ATTR(enhanced_area_offset, "%lld\n",
 		card->ext_csd.enhanced_area_offset);
-MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
+MMC_DEV_ATTR(enhanced_area_size, "%d KBytes\n",
+		card->ext_csd.enhanced_area_size);
 MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
 MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
 
Signature · 1 line
1.7.9.5