mtd: nand: sunxi: use mtd_div_by_ws() helper
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Thu Mar 24 11:59:02 PDT 2016
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=46c135c208a3a80bd7f12dee0032bbc6d507a0d9
Commit: 46c135c208a3a80bd7f12dee0032bbc6d507a0d9
Parent: 12197bf21c26e23053fa6223f3a731a965542986
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Fri Jan 22 18:57:13 2016 -0800
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Sat Jan 23 12:51:43 2016 -0800
mtd: nand: sunxi: use mtd_div_by_ws() helper
Suggested-by: Richard Weinberger <richard at nod.at>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
Acked-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
drivers/mtd/nand/sunxi_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
index 5f70071..b5ea6b3 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -624,7 +624,7 @@ static u16 sunxi_nfc_randomizer_step(u16 state, int count)
static u16 sunxi_nfc_randomizer_state(struct mtd_info *mtd, int page, bool ecc)
{
const u16 *seeds = sunxi_nfc_randomizer_page_seeds;
- int mod = mtd->erasesize / mtd->writesize;
+ int mod = mtd_div_by_ws(mtd->erasesize, mtd);
if (mod > ARRAY_SIZE(sunxi_nfc_randomizer_page_seeds))
mod = ARRAY_SIZE(sunxi_nfc_randomizer_page_seeds);
More information about the linux-mtd-cvs
mailing list