[PATCH 3/8] cfi flash driver: Use generic progression bar function

Sascha Hauer s.hauer at pengutronix.de
Thu Jun 24 05:35:03 EDT 2010


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/nor/cfi_flash.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/nor/cfi_flash.c b/drivers/nor/cfi_flash.c
index dbfb004..b21739b 100644
--- a/drivers/nor/cfi_flash.c
+++ b/drivers/nor/cfi_flash.c
@@ -42,6 +42,7 @@
 #include <malloc.h>
 #include <asm/io.h>
 #include <errno.h>
+#include <progress.h>
 #include "cfi_flash.h"
 
 /*
@@ -499,11 +500,13 @@ static int cfi_erase(struct cdev *cdev, size_t count, unsigned long offset)
         start = find_sector(finfo, cdev->dev->map_base + offset);
         end   = find_sector(finfo, cdev->dev->map_base + offset + count - 1);
 
+	init_progression_bar(end - start);
+
         for (i = start; i <= end; i++) {
                 ret = finfo->cfi_cmd_set->flash_erase_one(finfo, i);
                 if (ret)
                         goto out;
-		printf(".");
+		show_progress(i - start);
         }
 out:
         putchar('\n');
-- 
1.7.1




More information about the barebox mailing list