Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f39b56f6 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by David Woodhouse
Browse files

block/spectra: use do_div() for 64bit divs



it does not work on 32bit that way

Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 0dba333c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;