Thread (11 messages) 11 messages, 2 authors, 2014-10-19

Re: [PATCH 2/2] clk: ppc-corenet: don't use platform_driver to init the clock device

From: Scott Wood <hidden>
Date: 2014-10-16 21:55:48

On Thu, 2014-10-16 at 19:18 +0800, Kevin Hao wrote:
quoted hunk ↗ jump to hunk
In commit da788acb2838 ("clk: ppc-corenet: Fix Section mismatch
warning"), we put the ppc_corenet_clk_driver struct to init section
in order to fix section mismatch warning. This is definitely wrong
because the kernel would free the memories occupied by
ppc_corenet_clk_driver after boot while this driver is still registered
in the driver core. The kernel would panic when accessing this driver
struct. So choose to use CLK_OF_DECLARE to scan and init the clock devices.

Signed-off-by: Kevin Hao <redacted>
---
 arch/powerpc/platforms/85xx/corenet_generic.c |  7 +++++
 drivers/clk/clk-ppc-corenet.c                 | 43 ++++-----------------------
 2 files changed, 13 insertions(+), 37 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
index e56b89a792ed..7677cfecb787 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -16,6 +16,7 @@
 #include <linux/kdev_t.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/clk-provider.h>
 
 #include <asm/time.h>
 #include <asm/machdep.h>
@@ -188,11 +189,17 @@ static int __init corenet_generic_probe(void)
 	return 0;
 }
 
+static void __init corenet_gen_init(void)
+{
+	of_clk_init(NULL);
+}
Why is this board-specific?

-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help