1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-22 10:31:56 +02:00

mtd: cfi: introduce CFI_FLASH_BANKS

Replace CONFIG_SYS_MAX_FLASH_BANKS by CFI_FLASH_BANKS to prepare
Kconfig migration and avoid to redefine CONFIG_SYS_MAX_FLASH_BANKS
in cfi_flash.h.

After this patch CONFIG_SYS_MAX_FLASH_BANKS should be never used in
the cfi code: use CFI_MAX_FLASH_BANKS for struct size or CFI_FLASH_BANKS
for number of CFI banks which can be dynamic.

This patch modify all the files which include mtd/cfi_flash.h.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Patrick Delaunay
2022-01-04 14:23:58 +01:00
committed by Tom Rini
parent c8363b12b2
commit 98150e7e8c
8 changed files with 33 additions and 31 deletions

View File

@@ -112,12 +112,12 @@ static int update_flash_protect(int prot, ulong addr_first, ulong addr_last)
if (prot == 0) {
saved_prot_info =
calloc(CONFIG_SYS_MAX_FLASH_BANKS * CONFIG_SYS_MAX_FLASH_SECT, 1);
calloc(CFI_FLASH_BANKS * CONFIG_SYS_MAX_FLASH_SECT, 1);
if (!saved_prot_info)
return 1;
}
for (bank = 0; bank < CONFIG_SYS_MAX_FLASH_BANKS; ++bank) {
for (bank = 0; bank < CFI_FLASH_BANKS; ++bank) {
cnt = 0;
info = &flash_info[bank];