This series is doing code cleanup under arch/arm/mach-exynos.
These patches have been separated from main exynos pmu v4 patch
posted here [1].
[1]: https://lkml.org/lkml/2014/5/10/29
Changes Since v5:
- Rebased on latest for-next of Kukjin Kim's tree.
- Using of_machine_is_compatible instead of soc_is_exynos in patch 2.
Changes Since v4:
- Rebased on latest for-next of Kukjin Kim's tree.
- Removing file path comment from mach-exynos/headsmp.S also.
- Removed signed-off-by of Young-Gun Jang <[email protected]>,
as this id is no more valid. Taking ownership of all his patches.
- Separated these patches from main exynos pmu v4 patch series as
suggested by Tomasz Figa.
Changes Since v3:
- Addressed build fail issue in exynos.c as reported by Sachin Kamat.
- Rebased on top of Sysram patches by Sachin Kamat.
Changes Since v2:
- Rebased on top of Daniel Lezcano's Exynos cpuidle refactor patches.
- Removed exynos_cpuidle_init and exynos_cpufreq_init code as suggested
by Tomasz Figa.
Changes Since v1:
- Rebased on latest for-next of Kukjin Kim's tree.
- Added patch: "Make exynos machine_ops as static".
For making more cleanup in "mach-exynos/common.h"
as suggested by Tomasz Figa.
- Addressed comments of Tomasz Figa for cleaning "mach-exynos/common.h".
- Updated patch: Remove file path from comment section
As suggested by Michel Simek, instead of updating file path
lets remove them from each file under "mach-exynos".
Even though Kukjin pointed out that there is similar patch pending from
Sachin/Tushar but since I could not find I have included this here. If
I have missed something please point to any existing such patch.
- Added patch: Remove "linux/bug.h" from pmu.c.
- Added patch: Move "mach/map.h" inclusion from regs-pmu.h to platsmp.c
Pankaj Dubey (6):
ARM: EXYNOS: Make exynos machine_ops as static
ARM: EXYNOS: Move cpufreq and cpuidle device registration to
init_machine
ARM: EXYNOS: Move SYSREG definition into sys-reg specific file
ARM: EXYNOS: Remove file path from comment section
ARM: EXYNOS: Remove regs-pmu.h header dependency from pm_domain
ARM: EXYNOS: Remove "linux/bug.h" from pmu.c
arch/arm/mach-exynos/common.h | 8 --------
arch/arm/mach-exynos/exynos.c | 27 ++++++++-------------------
arch/arm/mach-exynos/headsmp.S | 1 -
arch/arm/mach-exynos/hotplug.c | 3 +--
arch/arm/mach-exynos/include/mach/map.h | 3 +--
arch/arm/mach-exynos/include/mach/memory.h | 3 +--
arch/arm/mach-exynos/platsmp.c | 3 +--
arch/arm/mach-exynos/pm.c | 1 +
arch/arm/mach-exynos/pm_domains.c | 8 ++++----
arch/arm/mach-exynos/pmu.c | 1 -
arch/arm/mach-exynos/regs-pmu.h | 4 ----
arch/arm/mach-exynos/regs-sys.h | 22 ++++++++++++++++++++++
12 files changed, 39 insertions(+), 45 deletions(-)
create mode 100644 arch/arm/mach-exynos/regs-sys.h
--
1.7.9.5
This patch removes unnecessary header file inclusion from pmu.c.
Signed-off-by: Pankaj Dubey <[email protected]>
Reviewed-by: Tomasz Figa <[email protected]>
---
arch/arm/mach-exynos/pmu.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index fb0deda..dcfcb44 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -11,7 +11,6 @@
#include <linux/io.h>
#include <linux/kernel.h>
-#include <linux/bug.h>
#include "common.h"
#include "regs-pmu.h"
--
1.7.9.5
Current "pm_domain.c" file uses "S5P_INT_LOCAL_PWR_EN" definition from
"regs-pmu.h" and hence needs to include this header file. As there is
no other user of "S5P_INT_LOCAL_PWR_EN" definition other than pm_domain,
to remove "regs-pmu.h" header file dependency from "pm_domain.c" it's
better we define this definition in "pm_domain.c" file itself and thus it
will help in removing header file inclusion from "pm_domain.c".
Also removing "S5P_" prefix from macro.
Signed-off-by: Pankaj Dubey <[email protected]>
Reviewed-by: Tomasz Figa <[email protected]>
---
arch/arm/mach-exynos/pm_domains.c | 8 ++++----
arch/arm/mach-exynos/regs-pmu.h | 1 -
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index fe6570e..bcd8dcf 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -22,7 +22,7 @@
#include <linux/of_platform.h>
#include <linux/sched.h>
-#include "regs-pmu.h"
+#define INT_LOCAL_PWR_EN 0x7
/*
* Exynos specific wrapper around the generic power domain
@@ -44,13 +44,13 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
pd = container_of(domain, struct exynos_pm_domain, pd);
base = pd->base;
- pwr = power_on ? S5P_INT_LOCAL_PWR_EN : 0;
+ pwr = power_on ? INT_LOCAL_PWR_EN : 0;
__raw_writel(pwr, base);
/* Wait max 1ms */
timeout = 10;
- while ((__raw_readl(base + 0x4) & S5P_INT_LOCAL_PWR_EN) != pwr) {
+ while ((__raw_readl(base + 0x4) & INT_LOCAL_PWR_EN) != pwr) {
if (!timeout) {
op = (power_on) ? "enable" : "disable";
pr_err("Power domain %s %s failed\n", domain->name, op);
@@ -172,7 +172,7 @@ static __init int exynos4_pm_init_power_domain(void)
platform_set_drvdata(pdev, pd);
- on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
+ on = __raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN;
pm_genpd_init(&pd->pd, NULL, !on);
}
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index e6fa6cf..e5e298c 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -128,7 +128,6 @@
#define S5P_PAD_RET_EBIB_OPTION S5P_PMUREG(0x31A8)
#define S5P_CORE_LOCAL_PWR_EN 0x3
-#define S5P_INT_LOCAL_PWR_EN 0x7
/* Only for EXYNOS4210 */
#define S5P_CMU_CLKSTOP_LCD1_LOWPWR S5P_PMUREG(0x1154)
--
1.7.9.5
Many files under "arm/mach-exynos" are having file path in file
comment section which is invalid now.
So for better code maintainability let's remove them.
Signed-off-by: Pankaj Dubey <[email protected]>
Reviewed-by: Tomasz Figa <[email protected]>
---
arch/arm/mach-exynos/headsmp.S | 1 -
arch/arm/mach-exynos/hotplug.c | 3 +--
arch/arm/mach-exynos/include/mach/map.h | 3 +--
arch/arm/mach-exynos/include/mach/memory.h | 3 +--
arch/arm/mach-exynos/platsmp.c | 3 +--
5 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-exynos/headsmp.S b/arch/arm/mach-exynos/headsmp.S
index cdd9d91..b54f970 100644
--- a/arch/arm/mach-exynos/headsmp.S
+++ b/arch/arm/mach-exynos/headsmp.S
@@ -1,5 +1,4 @@
/*
- * linux/arch/arm/mach-exynos4/headsmp.S
*
* Cloned from linux/arch/arm/mach-realview/headsmp.S
*
diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c
index 8a134d0..572f6b1 100644
--- a/arch/arm/mach-exynos/hotplug.c
+++ b/arch/arm/mach-exynos/hotplug.c
@@ -1,5 +1,4 @@
-/* linux arch/arm/mach-exynos4/hotplug.c
- *
+/*
* Cloned from linux/arch/arm/mach-realview/hotplug.c
*
* Copyright (C) 2002 ARM Ltd.
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index 548269a..963002f 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -1,5 +1,4 @@
-/* linux/arch/arm/mach-exynos/include/mach/map.h
- *
+/*
* Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
diff --git a/arch/arm/mach-exynos/include/mach/memory.h b/arch/arm/mach-exynos/include/mach/memory.h
index 2a4cdb7..e19df1f 100644
--- a/arch/arm/mach-exynos/include/mach/memory.h
+++ b/arch/arm/mach-exynos/include/mach/memory.h
@@ -1,5 +1,4 @@
-/* linux/arch/arm/mach-exynos4/include/mach/memory.h
- *
+/*
* Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 55ed2e6..cd25a9c 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -1,5 +1,4 @@
-/* linux/arch/arm/mach-exynos4/platsmp.c
- *
+ /*
* Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
--
1.7.9.5
While making PMU implementation to be device tree based, there are
few register offsets related with SYSREG present in regs-pmu.h, so
let's make a new header file "regs-sys.h" to keep all such SYSREG
related register offsets and remove them from "regs-pmu.h"
Signed-off-by: Pankaj Dubey <[email protected]>
Reviewed-by: Tomasz Figa <[email protected]>
---
arch/arm/mach-exynos/exynos.c | 1 +
arch/arm/mach-exynos/pm.c | 1 +
arch/arm/mach-exynos/regs-pmu.h | 3 ---
arch/arm/mach-exynos/regs-sys.h | 22 ++++++++++++++++++++++
4 files changed, 24 insertions(+), 3 deletions(-)
create mode 100644 arch/arm/mach-exynos/regs-sys.h
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 47170eb..186f35d 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -29,6 +29,7 @@
#include "common.h"
#include "mfc.h"
#include "regs-pmu.h"
+#include "regs-sys.h"
static struct map_desc exynos4_iodesc[] __initdata = {
{
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 202ca73..f127c0c 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -35,6 +35,7 @@
#include "common.h"
#include "regs-pmu.h"
+#include "regs-sys.h"
/**
* struct exynos_wkup_irq - Exynos GIC to PMU IRQ mapping
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index e1c06b6..e6fa6cf 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -15,7 +15,6 @@
#include <mach/map.h>
#define S5P_PMUREG(x) (S5P_VA_PMU + (x))
-#define S5P_SYSREG(x) (S3C_VA_SYS + (x))
#define S5P_CENTRAL_SEQ_CONFIGURATION S5P_PMUREG(0x0200)
@@ -190,8 +189,6 @@
/* For EXYNOS5 */
-#define EXYNOS5_SYS_I2C_CFG S5P_SYSREG(0x0234)
-
#define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408)
#define EXYNOS5_MASK_WDTRESET_REQUEST S5P_PMUREG(0x040C)
diff --git a/arch/arm/mach-exynos/regs-sys.h b/arch/arm/mach-exynos/regs-sys.h
new file mode 100644
index 0000000..84332b0
--- /dev/null
+++ b/arch/arm/mach-exynos/regs-sys.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * EXYNOS - system register definition
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_REGS_SYS_H
+#define __ASM_ARCH_REGS_SYS_H __FILE__
+
+#include <mach/map.h>
+
+#define S5P_SYSREG(x) (S3C_VA_SYS + (x))
+
+/* For EXYNOS5 */
+#define EXYNOS5_SYS_I2C_CFG S5P_SYSREG(0x0234)
+
+#endif /* __ASM_ARCH_REGS_SYS_H */
--
1.7.9.5
As exynos_cpuidle_init and exynos_cpufreq_init function have just one lines
of code for registering platform devices. We can move these lines to
exynos_dt_machine_init and delete exynos_cpuidle_init and exynos_cpufreq_init
function. This will help in reducing lines of code in exynos.c, making it
more cleaner.
Suggested-by: Tomasz Figa <[email protected]>
Signed-off-by: Pankaj Dubey <[email protected]>
Reviewed-by: Tomasz Figa <[email protected]>
---
arch/arm/mach-exynos/exynos.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index ff60b4c..47170eb 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -171,19 +171,6 @@ static struct platform_device exynos_cpuidle = {
.id = -1,
};
-void __init exynos_cpuidle_init(void)
-{
- if (soc_is_exynos5440())
- return;
-
- platform_device_register(&exynos_cpuidle);
-}
-
-void __init exynos_cpufreq_init(void)
-{
- platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
-}
-
void __iomem *sysram_base_addr;
void __iomem *sysram_ns_base_addr;
@@ -300,10 +287,11 @@ static void __init exynos_dt_machine_init(void)
if (!IS_ENABLED(CONFIG_SMP))
exynos_sysram_init();
- if (!of_machine_is_compatible("samsung,exynos5420"))
- exynos_cpuidle_init();
+ if (!of_machine_is_compatible("samsung,exynos5420") ||
+ !of_machine_is_compatible("samsung,exynos5440"))
+ platform_device_register(&exynos_cpuidle);
- exynos_cpufreq_init();
+ platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
--
1.7.9.5
As machine function ops are used only in this file let's make
them static. Also remove unused and unwanted declarations from
common.h.
Signed-off-by: Pankaj Dubey <[email protected]>
Reviewed-by: Tomasz Figa <[email protected]>
---
arch/arm/mach-exynos/common.h | 8 --------
arch/arm/mach-exynos/exynos.c | 6 +++---
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 3371669..152b464 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -111,17 +111,9 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \
soc_is_exynos5420() || soc_is_exynos5800())
-void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1);
-
-struct map_desc;
extern void __iomem *sysram_ns_base_addr;
extern void __iomem *sysram_base_addr;
-void exynos_init_io(void);
-void exynos_restart(enum reboot_mode mode, const char *cmd);
void exynos_sysram_init(void);
-void exynos_cpuidle_init(void);
-void exynos_cpufreq_init(void);
-void exynos_init_late(void);
void exynos_firmware_init(void);
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 471422e..ff60b4c 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -143,7 +143,7 @@ static struct map_desc exynos5_iodesc[] __initdata = {
},
};
-void exynos_restart(enum reboot_mode mode, const char *cmd)
+static void exynos_restart(enum reboot_mode mode, const char *cmd)
{
struct device_node *np;
u32 val = 0x1;
@@ -206,7 +206,7 @@ void __init exynos_sysram_init(void)
}
}
-void __init exynos_init_late(void)
+static void __init exynos_init_late(void)
{
if (of_machine_is_compatible("samsung,exynos5440"))
/* to be supported later */
@@ -253,7 +253,7 @@ static void __init exynos_map_io(void)
iotable_init(exynos5_iodesc, ARRAY_SIZE(exynos5_iodesc));
}
-void __init exynos_init_io(void)
+static void __init exynos_init_io(void)
{
debug_ll_io_init();
--
1.7.9.5
On 07/07/14 12:50, Pankaj Dubey wrote:
> This series is doing code cleanup under arch/arm/mach-exynos.
> These patches have been separated from main exynos pmu v4 patch
> posted here [1].
>
> [1]: https://lkml.org/lkml/2014/5/10/29
>
> Changes Since v5:
> - Rebased on latest for-next of Kukjin Kim's tree.
> - Using of_machine_is_compatible instead of soc_is_exynos in patch 2.
>
> Changes Since v4:
> - Rebased on latest for-next of Kukjin Kim's tree.
> - Removing file path comment from mach-exynos/headsmp.S also.
> - Removed signed-off-by of Young-Gun Jang<[email protected]>,
> as this id is no more valid. Taking ownership of all his patches.
> - Separated these patches from main exynos pmu v4 patch series as
> suggested by Tomasz Figa.
>
> Changes Since v3:
> - Addressed build fail issue in exynos.c as reported by Sachin Kamat.
> - Rebased on top of Sysram patches by Sachin Kamat.
>
> Changes Since v2:
> - Rebased on top of Daniel Lezcano's Exynos cpuidle refactor patches.
> - Removed exynos_cpuidle_init and exynos_cpufreq_init code as suggested
> by Tomasz Figa.
>
> Changes Since v1:
> - Rebased on latest for-next of Kukjin Kim's tree.
> - Added patch: "Make exynos machine_ops as static".
> For making more cleanup in "mach-exynos/common.h"
> as suggested by Tomasz Figa.
> - Addressed comments of Tomasz Figa for cleaning "mach-exynos/common.h".
> - Updated patch: Remove file path from comment section
> As suggested by Michel Simek, instead of updating file path
> lets remove them from each file under "mach-exynos".
> Even though Kukjin pointed out that there is similar patch pending from
> Sachin/Tushar but since I could not find I have included this here. If
> I have missed something please point to any existing such patch.
> - Added patch: Remove "linux/bug.h" from pmu.c.
> - Added patch: Move "mach/map.h" inclusion from regs-pmu.h to platsmp.c
>
>
> Pankaj Dubey (6):
> ARM: EXYNOS: Make exynos machine_ops as static
> ARM: EXYNOS: Move cpufreq and cpuidle device registration to
> init_machine
> ARM: EXYNOS: Move SYSREG definition into sys-reg specific file
> ARM: EXYNOS: Remove file path from comment section
> ARM: EXYNOS: Remove regs-pmu.h header dependency from pm_domain
> ARM: EXYNOS: Remove "linux/bug.h" from pmu.c
>
> arch/arm/mach-exynos/common.h | 8 --------
> arch/arm/mach-exynos/exynos.c | 27 ++++++++-------------------
> arch/arm/mach-exynos/headsmp.S | 1 -
> arch/arm/mach-exynos/hotplug.c | 3 +--
> arch/arm/mach-exynos/include/mach/map.h | 3 +--
> arch/arm/mach-exynos/include/mach/memory.h | 3 +--
> arch/arm/mach-exynos/platsmp.c | 3 +--
> arch/arm/mach-exynos/pm.c | 1 +
> arch/arm/mach-exynos/pm_domains.c | 8 ++++----
> arch/arm/mach-exynos/pmu.c | 1 -
> arch/arm/mach-exynos/regs-pmu.h | 4 ----
> arch/arm/mach-exynos/regs-sys.h | 22 ++++++++++++++++++++++
> 12 files changed, 39 insertions(+), 45 deletions(-)
> create mode 100644 arch/arm/mach-exynos/regs-sys.h
>
OK, looks good to me, I think we don't need 4/6 patch though :-)
I've applied this whole series, thanks.
- Kukjin
On 07/07/14 12:50, Pankaj Dubey wrote:
> As exynos_cpuidle_init and exynos_cpufreq_init function have just one lines
> of code for registering platform devices. We can move these lines to
> exynos_dt_machine_init and delete exynos_cpuidle_init and exynos_cpufreq_init
> function. This will help in reducing lines of code in exynos.c, making it
> more cleaner.
>
> Suggested-by: Tomasz Figa<[email protected]>
> Signed-off-by: Pankaj Dubey<[email protected]>
> Reviewed-by: Tomasz Figa<[email protected]>
> ---
> arch/arm/mach-exynos/exynos.c | 20 ++++----------------
> 1 file changed, 4 insertions(+), 16 deletions(-)
>
> diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
> index ff60b4c..47170eb 100644
> --- a/arch/arm/mach-exynos/exynos.c
> +++ b/arch/arm/mach-exynos/exynos.c
> @@ -171,19 +171,6 @@ static struct platform_device exynos_cpuidle = {
> .id = -1,
> };
>
> -void __init exynos_cpuidle_init(void)
> -{
> - if (soc_is_exynos5440())
> - return;
> -
> - platform_device_register(&exynos_cpuidle);
> -}
> -
> -void __init exynos_cpufreq_init(void)
> -{
> - platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
> -}
> -
> void __iomem *sysram_base_addr;
> void __iomem *sysram_ns_base_addr;
>
> @@ -300,10 +287,11 @@ static void __init exynos_dt_machine_init(void)
> if (!IS_ENABLED(CONFIG_SMP))
> exynos_sysram_init();
>
> - if (!of_machine_is_compatible("samsung,exynos5420"))
> - exynos_cpuidle_init();
> + if (!of_machine_is_compatible("samsung,exynos5420") ||
> + !of_machine_is_compatible("samsung,exynos5440"))
> + platform_device_register(&exynos_cpuidle);
>
> - exynos_cpufreq_init();
> + platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
>
> of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> }
This cannot be applied in my tree now....
- Kukjin
Hi Kukjin,
>
> On 07/07/14 12:50, Pankaj Dubey wrote:
> > As exynos_cpuidle_init and exynos_cpufreq_init function have just one
> > lines of code for registering platform devices. We can move these
> > lines to exynos_dt_machine_init and delete exynos_cpuidle_init and
> > exynos_cpufreq_init function. This will help in reducing lines of code
> > in exynos.c, making it more cleaner.
> >
> > Suggested-by: Tomasz Figa<[email protected]>
> > Signed-off-by: Pankaj Dubey<[email protected]>
> > Reviewed-by: Tomasz Figa<[email protected]>
> > ---
> > arch/arm/mach-exynos/exynos.c | 20 ++++----------------
> > 1 file changed, 4 insertions(+), 16 deletions(-)
> >
> > diff --git a/arch/arm/mach-exynos/exynos.c
> > b/arch/arm/mach-exynos/exynos.c index ff60b4c..47170eb 100644
> > --- a/arch/arm/mach-exynos/exynos.c
> > +++ b/arch/arm/mach-exynos/exynos.c
> > @@ -171,19 +171,6 @@ static struct platform_device exynos_cpuidle = {
> > .id = -1,
> > };
> >
> > -void __init exynos_cpuidle_init(void) -{
> > - if (soc_is_exynos5440())
> > - return;
> > -
> > - platform_device_register(&exynos_cpuidle);
> > -}
> > -
> > -void __init exynos_cpufreq_init(void) -{
> > - platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
> > -}
> > -
> > void __iomem *sysram_base_addr;
> > void __iomem *sysram_ns_base_addr;
> >
> > @@ -300,10 +287,11 @@ static void __init exynos_dt_machine_init(void)
> > if (!IS_ENABLED(CONFIG_SMP))
> > exynos_sysram_init();
> >
> > - if (!of_machine_is_compatible("samsung,exynos5420"))
> > - exynos_cpuidle_init();
> > + if (!of_machine_is_compatible("samsung,exynos5420") ||
> > + !of_machine_is_compatible("samsung,exynos5440"))
> > + platform_device_register(&exynos_cpuidle);
> >
> > - exynos_cpufreq_init();
> > + platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
> >
> > of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> > }
>
> This cannot be applied in my tree now....
>
May I know what the issue is? As I am able to rebase this patch on today's
kgene/for-next
and could not see any merge conflict.
If you think I need to respin this patch please let me know.
Thanks,
Pankaj Dubey
> - Kukjin
Pankaj Dubey wrote:
>
> Hi Kukjin,
>
Hi,
> >
> > On 07/07/14 12:50, Pankaj Dubey wrote:
> > > As exynos_cpuidle_init and exynos_cpufreq_init function have just one
> > > lines of code for registering platform devices. We can move these
> > > lines to exynos_dt_machine_init and delete exynos_cpuidle_init and
> > > exynos_cpufreq_init function. This will help in reducing lines of code
> > > in exynos.c, making it more cleaner.
> > >
> > > Suggested-by: Tomasz Figa<[email protected]>
> > > Signed-off-by: Pankaj Dubey<[email protected]>
> > > Reviewed-by: Tomasz Figa<[email protected]>
> > > ---
> > > arch/arm/mach-exynos/exynos.c | 20 ++++----------------
> > > 1 file changed, 4 insertions(+), 16 deletions(-)
> > >
> > > diff --git a/arch/arm/mach-exynos/exynos.c
> > > b/arch/arm/mach-exynos/exynos.c index ff60b4c..47170eb 100644
> > > --- a/arch/arm/mach-exynos/exynos.c
> > > +++ b/arch/arm/mach-exynos/exynos.c
> > > @@ -171,19 +171,6 @@ static struct platform_device exynos_cpuidle = {
> > > .id = -1,
> > > };
> > >
> > > -void __init exynos_cpuidle_init(void) -{
> > > - if (soc_is_exynos5440())
> > > - return;
> > > -
> > > - platform_device_register(&exynos_cpuidle);
> > > -}
> > > -
> > > -void __init exynos_cpufreq_init(void) -{
> > > - platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
> > > -}
> > > -
> > > void __iomem *sysram_base_addr;
> > > void __iomem *sysram_ns_base_addr;
> > >
> > > @@ -300,10 +287,11 @@ static void __init exynos_dt_machine_init(void)
> > > if (!IS_ENABLED(CONFIG_SMP))
> > > exynos_sysram_init();
> > >
> > > - if (!of_machine_is_compatible("samsung,exynos5420"))
> > > - exynos_cpuidle_init();
> > > + if (!of_machine_is_compatible("samsung,exynos5420") ||
> > > + !of_machine_is_compatible("samsung,exynos5440"))
> > > + platform_device_register(&exynos_cpuidle);
> > >
> > > - exynos_cpufreq_init();
> > > + platform_device_register_simple("exynos-cpufreq", -1, NULL, 0);
> > >
> > > of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> > > }
> >
> > This cannot be applied in my tree now....
> >
>
> May I know what the issue is? As I am able to rebase this patch on today's
> kgene/for-next
> and could not see any merge conflict.
> If you think I need to respin this patch please let me know.
>
Pankaj, I found this is based on cpuidle related branch in my tree, BTW this
has a dependency with following so please respin your patch once I take the
patch in my tree maybe tonight.
https://lkml.org/lkml/2014/6/24/286
Thanks,
Kukjin
Hi Kukjin,
On Thursday, July 10, 2014 7:04 PM, Kukjin wrote:
> Pankaj Dubey wrote:
> >
> > Hi Kukjin,
> >
> Hi,
>
> > >
> > > On 07/07/14 12:50, Pankaj Dubey wrote:
> > > > As exynos_cpuidle_init and exynos_cpufreq_init function have just
> > > > one lines of code for registering platform devices. We can move
> > > > these lines to exynos_dt_machine_init and delete
> > > > exynos_cpuidle_init and exynos_cpufreq_init function. This will
> > > > help in reducing lines of code in exynos.c, making it more cleaner.
> > > >
> > > > Suggested-by: Tomasz Figa<[email protected]>
> > > > Signed-off-by: Pankaj Dubey<[email protected]>
> > > > Reviewed-by: Tomasz Figa<[email protected]>
> > > > ---
> > > > arch/arm/mach-exynos/exynos.c | 20 ++++----------------
> > > > 1 file changed, 4 insertions(+), 16 deletions(-)
> > > >
> > > > diff --git a/arch/arm/mach-exynos/exynos.c
> > > > b/arch/arm/mach-exynos/exynos.c index ff60b4c..47170eb 100644
> > > > --- a/arch/arm/mach-exynos/exynos.c
> > > > +++ b/arch/arm/mach-exynos/exynos.c
> > > > @@ -171,19 +171,6 @@ static struct platform_device exynos_cpuidle =
{
> > > > .id = -1,
> > > > };
> > > >
> > > > -void __init exynos_cpuidle_init(void) -{
> > > > - if (soc_is_exynos5440())
> > > > - return;
> > > > -
> > > > - platform_device_register(&exynos_cpuidle);
> > > > -}
> > > > -
> > > > -void __init exynos_cpufreq_init(void) -{
> > > > - platform_device_register_simple("exynos-cpufreq", -1, NULL,
0);
> > > > -}
> > > > -
> > > > void __iomem *sysram_base_addr;
> > > > void __iomem *sysram_ns_base_addr;
> > > >
> > > > @@ -300,10 +287,11 @@ static void __init
exynos_dt_machine_init(void)
> > > > if (!IS_ENABLED(CONFIG_SMP))
> > > > exynos_sysram_init();
> > > >
> > > > - if (!of_machine_is_compatible("samsung,exynos5420"))
> > > > - exynos_cpuidle_init();
> > > > + if (!of_machine_is_compatible("samsung,exynos5420") ||
> > > > +
!of_machine_is_compatible("samsung,exynos5440"))
> > > > + platform_device_register(&exynos_cpuidle);
> > > >
> > > > - exynos_cpufreq_init();
> > > > + platform_device_register_simple("exynos-cpufreq", -1, NULL,
0);
> > > >
> > > > of_platform_populate(NULL, of_default_bus_match_table, NULL,
> NULL);
> > > > }
> > >
> > > This cannot be applied in my tree now....
> > >
> >
> > May I know what the issue is? As I am able to rebase this patch on
> > today's kgene/for-next and could not see any merge conflict.
> > If you think I need to respin this patch please let me know.
> >
>
> Pankaj, I found this is based on cpuidle related branch in my tree, BTW
this
> has a dependency with following so please respin your patch once I take
the
> patch in my tree maybe tonight.
>
> https://lkml.org/lkml/2014/6/24/286
>
Thanks. I have respinned this after resolving merge conflict.
Thanks,
Pankaj Dubey
> Thanks,
> Kukjin