The behavior get_clocks depends on the unitialized
value of bootmode.

By setting it to zero we get a defined behavior and
can get rid of superfluos coding.

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.g...@gmx.de>
---
I have no hardware to test this.
Please, check thorougly before merging.
---
---
 arch/m68k/cpu/mcf5227x/speed.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/m68k/cpu/mcf5227x/speed.c b/arch/m68k/cpu/mcf5227x/speed.c
index 44de4a6701..978cc7adc6 100644
--- a/arch/m68k/cpu/mcf5227x/speed.c
+++ b/arch/m68k/cpu/mcf5227x/speed.c
@@ -73,14 +73,8 @@ int get_clocks(void)
 
        ccm_t *ccm = (ccm_t *)MMAP_CCM;
        pll_t *pll = (pll_t *)MMAP_PLL;
-       int vco, temp, pcrvalue, pfdr;
-       u8 bootmode;
-
-       pcrvalue = in_be32(&pll->pcr) & 0xFF0F0FFF;
-       pfdr = pcrvalue >> 24;
-
-       if (pfdr == 0x1E)
-               bootmode = 0;   /* Normal Mode */
+       int vco, temp, pcrvalue;
+       u8 bootmode = 0;        /* Normal Mode */;
 
 #ifdef CONFIG_CF_SBF
        bootmode = 3;           /* Serial Mode */
-- 
2.13.2

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to