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

Scott Wood scottwood at freescale.com
Fri Oct 17 08:55:23 AEDT 2014


On Thu, 2014-10-16 at 19:18 +0800, Kevin Hao wrote:
> 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 <haokexin at gmail.com>
> ---
>  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




More information about the Linuxppc-dev mailing list