]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
imx: mx6 correct is_soc_rev usage
authorPeng Fan <Peng.Fan@freescale.com>
Thu, 11 Jun 2015 10:30:35 +0000 (18:30 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 22:46:56 +0000 (00:46 +0200)
is_soc_rev should return a bool value, so use "==", but not "-",
change (is_soc_rev(CHIP_REV_1_0) > 0) to (soc_rev() > CHIP_REV_1_0).
This patch also add space between "&" for cpu_type(rev) macro.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
arch/arm/imx-common/timer.c
arch/arm/include/asm/arch-mx6/sys_proto.h

index d471b9a47a55083cdcaf69eb7f7cf043aa5d6130..5f28f9ee0847237d2565287d0876feda53a97906 100644 (file)
@@ -44,8 +44,8 @@ static inline int gpt_has_clk_source_osc(void)
 {
 #if defined(CONFIG_SOC_MX6)
        if (((is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D)) &&
-            (is_soc_rev(CHIP_REV_1_0) > 0)) || is_cpu_type(MXC_CPU_MX6DL) ||
-             is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6SX))
+           (soc_rev() > CHIP_REV_1_0)) || is_cpu_type(MXC_CPU_MX6DL) ||
+            is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6SX))
                return 1;
 
        return 0;
index 552818954db79d2201a1767c8f9353c54b8b5aa9..e9f5ead0e823175b59f9a4123fd6ad077a06380f 100644 (file)
@@ -12,7 +12,7 @@
 #include "../arch-imx/cpu.h"
 
 #define soc_rev() (get_cpu_rev() & 0xFF)
-#define is_soc_rev(rev)        (soc_rev() - rev)
+#define is_soc_rev(rev) (soc_rev() == rev)
 
 u32 get_nr_cpus(void);
 u32 get_cpu_rev(void);
@@ -20,7 +20,7 @@ u32 get_cpu_speed_grade_hz(void);
 u32 get_cpu_temp_grade(int *minc, int *maxc);
 
 /* returns MXC_CPU_ value */
-#define cpu_type(rev) (((rev) >> 12)&0xff)
+#define cpu_type(rev) (((rev) >> 12) & 0xff)
 
 /* both macros return/take MXC_CPU_ constants */
 #define get_cpu_type() (cpu_type(get_cpu_rev()))