summaryrefslogtreecommitdiff
path: root/drivers/mtd/st_smi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/st_smi.c')
-rw-r--r--drivers/mtd/st_smi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mtd/st_smi.c b/drivers/mtd/st_smi.c
index 976b097..5378b57 100644
--- a/drivers/mtd/st_smi.c
+++ b/drivers/mtd/st_smi.c
@@ -471,8 +471,13 @@ void flash_print_info(flash_info_t *info)
puts("missing or unknown FLASH type\n");
return;
}
- printf(" Size: %ld MB in %d Sectors\n",
- info->size >> 20, info->sector_count);
+
+ if (info->size >= 0x100000)
+ printf(" Size: %ld MB in %d Sectors\n",
+ info->size >> 20, info->sector_count);
+ else
+ printf(" Size: %ld KB in %d Sectors\n",
+ info->size >> 10, info->sector_count);
puts(" Sector Start Addresses:");
for (i = 0; i < info->sector_count; ++i) {