From: Johannes Stezenbach <js@sig21.net>
To: barebox@lists.infradead.org
Subject: [PATCH 3/5] m25p80: progressbar tweak
Date: Wed, 6 Jun 2012 18:04:58 +0200 [thread overview]
Message-ID: <1338998700-23012-4-git-send-email-js@sig21.net> (raw)
In-Reply-To: <1338998700-23012-1-git-send-email-js@sig21.net>
Show progressbar even when erasing just a single sector,
otherwise it looks as if erase didn't do anything.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
---
drivers/nor/m25p80.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nor/m25p80.c b/drivers/nor/m25p80.c
index 86e6d25..77669c2 100644
--- a/drivers/nor/m25p80.c
+++ b/drivers/nor/m25p80.c
@@ -214,7 +214,7 @@ static ssize_t m25p80_erase(struct cdev *cdev, size_t count, unsigned long offse
start_sector = offset / flash->erasesize;
end_sector = (offset + count - 1) / flash->erasesize;
- init_progression_bar(end_sector - start_sector);
+ init_progression_bar(end_sector - start_sector + 1);
/* whole-chip erase? */
if (len == flash->size) {
@@ -237,11 +237,11 @@ static ssize_t m25p80_erase(struct cdev *cdev, size_t count, unsigned long offse
if (erase_sector(flash, addr))
return -EIO;
+ show_progress(++progress);
if (len <= flash->erasesize)
break;
addr += flash->erasesize;
len -= flash->erasesize;
- show_progress(progress++);
}
}
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-06-06 16:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-06 16:04 [PATCH 0/5] minor SPI flash fixes Johannes Stezenbach
2012-06-06 16:04 ` [PATCH 1/5] m25p80: prevent endless loop in erase Johannes Stezenbach
2012-06-06 16:04 ` [PATCH 2/5] m25p80: allow erase to be interrupted Johannes Stezenbach
2012-06-06 16:04 ` Johannes Stezenbach [this message]
2012-06-06 16:04 ` [PATCH 4/5] devfs: don't erase past the end of the partition Johannes Stezenbach
2012-06-06 16:05 ` [PATCH 5/5] fs: limit flash erase and protect to the partiton boundary Johannes Stezenbach
2012-06-07 17:32 ` [PATCH 0/5] minor SPI flash fixes Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1338998700-23012-4-git-send-email-js@sig21.net \
--to=js@sig21.net \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox