]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
mtd: stm32: use parameter instead of default value
authorPatrice Chotard <patrice.chotard@st.com>
Tue, 4 Jul 2017 16:24:43 +0000 (18:24 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 10 Jul 2017 18:26:05 +0000 (14:26 -0400)
To set wait state, a hard coded value is used instead of using
latency parameter. stm32_flash_latency_cfg() is currently used
in arch/arm/mach-stm32/stm32f4/clock.c and in
drivers/clk/clk_stm32f7.c with, in both case, "5" as parameter.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
drivers/mtd/stm32_flash.c

index e16b6cd674fc9684e989f07f50082a83f52ed8b2..472499d83c3bf1ce5d09b3ea5c9feffd4e046fdc 100644 (file)
@@ -17,7 +17,7 @@ flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];
 void stm32_flash_latency_cfg(int latency)
 {
        /* 5 wait states, Prefetch enabled, D-Cache enabled, I-Cache enabled */
-       writel(FLASH_ACR_WS(5) | FLASH_ACR_PRFTEN | FLASH_ACR_ICEN
+       writel(FLASH_ACR_WS(latency) | FLASH_ACR_PRFTEN | FLASH_ACR_ICEN
                | FLASH_ACR_DCEN, &STM32_FLASH->acr);
 }