[PATCH v2 2/2] mtd: cfi: change cfi_flash_bank_size() return type

Nuno Sá nuno.sa at analog.com
Tue Apr 18 15:07:28 CEST 2023


Move return type to phys_size_t instead of plain unsigned long.

Signed-off-by: Nuno Sá <nuno.sa at analog.com>
---
v2:
 * new patch.

 drivers/mtd/cfi_flash.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 47a48d927201..9c030de3afef 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -117,7 +117,7 @@ phys_addr_t cfi_flash_bank_addr(int i)
 	return flash_info[i].base;
 }
 
-unsigned long cfi_flash_bank_size(int i)
+phys_size_t cfi_flash_bank_size(int i)
 {
 	return flash_info[i].addr_size;
 }
@@ -127,10 +127,10 @@ __weak phys_addr_t cfi_flash_bank_addr(int i)
 	return ((phys_addr_t [])CFG_SYS_FLASH_BANKS_LIST)[i];
 }
 
-__weak unsigned long cfi_flash_bank_size(int i)
+__weak phys_size_t cfi_flash_bank_size(int i)
 {
 #ifdef CFG_SYS_FLASH_BANKS_SIZES
-	return ((unsigned long [])CFG_SYS_FLASH_BANKS_SIZES)[i];
+	return ((phys_size_t [])CFG_SYS_FLASH_BANKS_SIZES)[i];
 #else
 	return 0;
 #endif
@@ -2112,7 +2112,7 @@ ulong flash_get_size(phys_addr_t base, int banknum)
 	int erase_region_size;
 	int erase_region_count;
 	struct cfi_qry qry;
-	unsigned long max_size;
+	phys_size_t max_size;
 
 	memset(&qry, 0, sizeof(qry));
 
-- 
2.40.0



More information about the U-Boot mailing list