]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
block/spectra: use do_div() for 64bit divs
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 2 Jun 2010 13:08:36 +0000 (15:08 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 7 Jun 2010 15:24:14 +0000 (16:24 +0100)
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>
drivers/block/spectra/lld_mtd.c

index f5666a9792b54a129140003614e0f117365fbf16..0de05b1e75f76f6d23a8552fe7cb9c813498aec9 100644 (file)
@@ -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;