diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2010-06-02 15:08:36 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-06-07 16:24:14 +0100 |
commit | f39b56f6d067786b6c37c9a20776d1c0eb405a49 (patch) | |
tree | ae5d6ab050718f2a5c278fd4bd148ab00960d0f8 /drivers | |
parent | 0dba333c9568b35c9278c98be6d7861a7a709ca9 (diff) |
block/spectra: use do_div() for 64bit divs
it does not work on 32bit that way
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/spectra/lld_mtd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/spectra/lld_mtd.c b/drivers/block/spectra/lld_mtd.c index f5666a9792b5..0de05b1e75f7 100644 --- a/drivers/block/spectra/lld_mtd.c +++ b/drivers/block/spectra/lld_mtd.c @@ -99,6 +99,7 @@ int mtd_Flash_Release(void) u16 mtd_Read_Device_ID(void) { + uint64_t tmp; nand_dbg_print(NAND_DBG_TRACE, "%s, Line %d, Function: %s\n", __FILE__, __LINE__, __func__); @@ -108,7 +109,9 @@ u16 mtd_Read_Device_ID(void) DeviceInfo.wDeviceMaker = 0; DeviceInfo.wDeviceType = 8; DeviceInfo.wSpectraStartBlock = SPECTRA_START_BLOCK; - DeviceInfo.wTotalBlocks = spectra_mtd->size / spectra_mtd->erasesize; + tmp = spectra_mtd->size; + do_div(tmp, spectra_mtd->erasesize); + DeviceInfo.wTotalBlocks = tmp; DeviceInfo.wSpectraEndBlock = DeviceInfo.wTotalBlocks - 1; DeviceInfo.wPagesPerBlock = spectra_mtd->erasesize / spectra_mtd->writesize; DeviceInfo.wPageSize = spectra_mtd->writesize + spectra_mtd->oobsize; |