From: Vadzim Dambrouski Date: Fri, 23 Oct 2015 18:14:06 +0000 (+0300) Subject: arm: stm32f4: fix a bug when only first sector gets erased X-Git-Tag: v2025.01-rc5-pxa1908~11288^2~7 X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-logo.png?a=commitdiff_plain;h=4cd3246f2a3a3a5032edcaed3cf807dd916f0aea;p=u-boot.git arm: stm32f4: fix a bug when only first sector gets erased flash_lock call is inside a for loop, so after the first iteration flash is locked and no more sectors can be erased. Move flash_lock out of the loop. Signed-off-by: Vadzim Dambrouski --- diff --git a/arch/arm/cpu/armv7m/stm32f4/flash.c b/arch/arm/cpu/armv7m/stm32f4/flash.c index e5c6111330..ae6379070f 100644 --- a/arch/arm/cpu/armv7m/stm32f4/flash.c +++ b/arch/arm/cpu/armv7m/stm32f4/flash.c @@ -114,9 +114,9 @@ int flash_erase(flash_info_t *info, int first, int last) ; clrbits_le32(&STM32_FLASH->cr, STM32_FLASH_CR_SER); - stm32f4_flash_lock(1); } + stm32f4_flash_lock(1); return 0; }