From: Oleksij Rempel <linux@rempel-privat.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] cfi_flash: size_ratio should not be 0
Date: Wed, 22 May 2013 09:53:40 +0200 [thread overview]
Message-ID: <1369209220-14529-3-git-send-email-linux@rempel-privat.de> (raw)
In-Reply-To: <1369209220-14529-1-git-send-email-linux@rempel-privat.de>
We will get size = 0 if size_ratio = 0
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
---
drivers/mtd/nor/cfi_flash.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nor/cfi_flash.c b/drivers/mtd/nor/cfi_flash.c
index 4b4e29d..85e96ce 100644
--- a/drivers/mtd/nor/cfi_flash.c
+++ b/drivers/mtd/nor/cfi_flash.c
@@ -371,7 +371,8 @@ static ulong flash_get_size (struct flash_info *info)
size_ratio = info->portwidth / info->chipwidth;
/* if the chip is x8/x16 reduce the ratio by half */
if ((info->interface == FLASH_CFI_X8X16)
- && (info->chipwidth == FLASH_CFI_BY8)) {
+ && (info->chipwidth == FLASH_CFI_BY8)
+ && (size_ratio != 1)) {
size_ratio >>= 1;
}
debug ("size_ratio %d port %d bits chip %d bits\n",
--
1.8.1.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-05-22 7:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 7:53 [PATCH 0/2] cfi fixes Oleksij Rempel
2013-05-22 7:53 ` [PATCH 1/2 v2] cfi_flash: add shift option for some cfi memory chips Oleksij Rempel
2013-05-23 13:13 ` Sascha Hauer
2013-05-22 7:53 ` Oleksij Rempel [this message]
2013-05-23 13:13 ` [PATCH 2/2] cfi_flash: size_ratio should not be 0 Sascha Hauer
2013-05-23 13:37 ` Oleksij Rempel
2013-05-27 8:30 ` 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=1369209220-14529-3-git-send-email-linux@rempel-privat.de \
--to=linux@rempel-privat.de \
--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