]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
cfi_flash: use buffer length in unmap_physmem()
authorKuo-Jung Su <dantesu@faraday-tech.com>
Thu, 4 Jul 2013 03:40:36 +0000 (11:40 +0800)
committerStefan Roese <sr@denx.de>
Thu, 25 Jul 2013 14:43:40 +0000 (16:43 +0200)
While the flash_detect_legacy() of drivers/mtd/cfi_flash.c
feed unmap_physmem() with MAP_NOCACHE as 2nd parameter,
the do_spi_flash_read_write() of common/cmd_sf.c
feed unmap_physmem() with the length of the mapped buffer
as 2nd parameter.

It's apparently a bug, and I personally think the 2nd parameter
should be the length of the mapped buffer.

Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com>
CC: Albert Aribaud <albert.u.boot@aribaud.net>
CC: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/cfi_flash.c

index 25a5710758971ea674cf9c63e5728d993d12c94f..616750d77e2f2ad2c47e44dc61f0bd3d81b509ca 100644 (file)
@@ -1820,7 +1820,7 @@ static int flash_detect_legacy(phys_addr_t base, int banknum)
                                        break;
                                else
                                        unmap_physmem((void *)info->start[0],
-                                                     MAP_NOCACHE);
+                                                     info->portwidth);
                        }
                }