Blackfin arch: do not allow people to pass in a diff clkin_hz value
authorMike Frysinger <vapier.adi@gmail.com>
Wed, 7 Jan 2009 15:14:38 +0000 (23:14 +0800)
committerBryan Wu <cooloney@kernel.org>
Wed, 7 Jan 2009 15:14:38 +0000 (23:14 +0800)
do not allow people to pass in a diff clkin_hz value when
reprogramming clocks -- it is too late currently

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
arch/blackfin/kernel/setup.c

index c05e5e3bad68bb53f1411ec0ce6f67b0cc37ccfd..4dffb913147e663c9005e35302766404f6e7f79a 100644 (file)
@@ -951,6 +951,10 @@ static u_long get_clkin_hz(void)
 static int __init early_init_clkin_hz(char *buf)
 {
        cached_clkin_hz = simple_strtoul(buf, NULL, 0);
+#ifdef BFIN_KERNEL_CLOCK
+       if (cached_clkin_hz != CONFIG_CLKIN_HZ)
+               panic("cannot change clkin_hz when reprogramming clocks");
+#endif
        return 1;
 }
 early_param("clkin_hz=", early_init_clkin_hz);