Dear Chander Kashyap,
On 27 December 2011 17:48, Chander Kashyap chander.kashyap@linaro.org wrote:
Torsten Koschorrek koschorrek@synertronixx.de scb9328 ARM920T (i.MXL) diff --git a/arch/arm/cpu/armv7/exynos/clock.c b/arch/arm/cpu/armv7/exynos/clock.c index b101f96..88e2fc0 100644 --- a/arch/arm/cpu/armv7/exynos/clock.c +++ b/arch/arm/cpu/armv7/exynos/clock.c @@ -125,10 +125,14 @@ static unsigned long exynos_get_pwm_clk(void)
if (s5p_get_cpu_rev() == 0) { /*
- * CLK_SRC_PERIL0
- * CLK_SRC_{PERIL0 | PERIC0}
* PWM_SEL [27:24] */ +#ifdef CONFIG_EXYNOS5
- sel = readl(&clk->src_peric0);
+#else sel = readl(&clk->src_peril0); +#endif
NAK. We don't allow to using ifdef for separating SoCs. Please refer s5pc1xx case for solve it. This comment apply to this patch globally. Please remove '#ifdef CONFIG_EXYNOS5'.
I have tried to reuse the code. It is possible to remove #ifdef CONFIG_EXYNOS5' in clock.c with cpu_is_s5pcXXX check. Is it a acceptable solution? Or is it necessary to write SoC specific function in clock.c as done in case of s5pc1xx/clock.c.
Please Advice
Removing CONFIG_EXYNOS5 and following s5pc1xx case will not allow to reuse the code in clock.c. What is the technical hindrance of not using ifdefs?
No need to reuse the code, if SoCs are different. If need, please separate the functions.
like this,
unsigned long get_arm_clk(void) { if (cpu_is_s5pc110()) return s5pc110_get_arm_clk(); else return s5pc100_get_arm_clk(); }
Thanks. Minkyu Kang