cfi driver: Limit device size to actual size
When probing CFI, limit the device size to the actual probed size of the flash Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
7e9bb400cf
commit
db572dce5f
|
@ -316,6 +316,12 @@ static int cfi_probe (struct device_d *dev)
|
|||
/* Init: no FLASHes known */
|
||||
info->flash_id = FLASH_UNKNOWN;
|
||||
size += info->size = flash_get_size(info, dev->map_base);
|
||||
|
||||
if (dev->size > size) {
|
||||
dev_dbg(dev, "limiting size from 0x%08x to 0x%08x\n", dev->size, size);
|
||||
dev->size = size;
|
||||
}
|
||||
|
||||
if (info->flash_id == FLASH_UNKNOWN) {
|
||||
debug ("## Unknown FLASH on Bank at 0x%08x - Size = 0x%08lx = %ld MB\n",
|
||||
dev->map_base, info->size, info->size << 20);
|
||||
|
|
Loading…
Reference in New Issue