Loading drivers/clk/mvebu/clk-cpu.c +3 −1 Original line number Original line Diff line number Diff line Loading @@ -119,7 +119,7 @@ void __init of_cpu_clk_setup(struct device_node *node) cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL); cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL); if (WARN_ON(!cpuclk)) if (WARN_ON(!cpuclk)) return; goto cpuclk_out; clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL); clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL); if (WARN_ON(!clks)) if (WARN_ON(!clks)) Loading Loading @@ -170,6 +170,8 @@ void __init of_cpu_clk_setup(struct device_node *node) kfree(cpuclk[ncpus].clk_name); kfree(cpuclk[ncpus].clk_name); clks_out: clks_out: kfree(cpuclk); kfree(cpuclk); cpuclk_out: iounmap(clock_complex_base); } } CLK_OF_DECLARE(armada_xp_cpu_clock, "marvell,armada-xp-cpu-clock", CLK_OF_DECLARE(armada_xp_cpu_clock, "marvell,armada-xp-cpu-clock", Loading drivers/clk/mvebu/common.c +12 −6 Original line number Original line Diff line number Diff line Loading @@ -45,8 +45,10 @@ void __init mvebu_coreclk_setup(struct device_node *np, clk_data.clk_num = 2 + desc->num_ratios; clk_data.clk_num = 2 + desc->num_ratios; clk_data.clks = kzalloc(clk_data.clk_num * sizeof(struct clk *), clk_data.clks = kzalloc(clk_data.clk_num * sizeof(struct clk *), GFP_KERNEL); GFP_KERNEL); if (WARN_ON(!clk_data.clks)) if (WARN_ON(!clk_data.clks)) { iounmap(base); return; return; } /* Register TCLK */ /* Register TCLK */ of_property_read_string_index(np, "clock-output-names", 0, of_property_read_string_index(np, "clock-output-names", 0, Loading Loading @@ -134,7 +136,7 @@ void __init mvebu_clk_gating_setup(struct device_node *np, ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); if (WARN_ON(!ctrl)) if (WARN_ON(!ctrl)) return; goto ctrl_out; spin_lock_init(&ctrl->lock); spin_lock_init(&ctrl->lock); Loading @@ -145,10 +147,8 @@ void __init mvebu_clk_gating_setup(struct device_node *np, ctrl->num_gates = n; ctrl->num_gates = n; ctrl->gates = kzalloc(ctrl->num_gates * sizeof(struct clk *), ctrl->gates = kzalloc(ctrl->num_gates * sizeof(struct clk *), GFP_KERNEL); GFP_KERNEL); if (WARN_ON(!ctrl->gates)) { if (WARN_ON(!ctrl->gates)) kfree(ctrl); goto gates_out; return; } for (n = 0; n < ctrl->num_gates; n++) { for (n = 0; n < ctrl->num_gates; n++) { const char *parent = const char *parent = Loading @@ -160,4 +160,10 @@ void __init mvebu_clk_gating_setup(struct device_node *np, } } of_clk_add_provider(np, clk_gating_get_src, ctrl); of_clk_add_provider(np, clk_gating_get_src, ctrl); return; gates_out: kfree(ctrl); ctrl_out: iounmap(base); } } Loading
drivers/clk/mvebu/clk-cpu.c +3 −1 Original line number Original line Diff line number Diff line Loading @@ -119,7 +119,7 @@ void __init of_cpu_clk_setup(struct device_node *node) cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL); cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL); if (WARN_ON(!cpuclk)) if (WARN_ON(!cpuclk)) return; goto cpuclk_out; clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL); clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL); if (WARN_ON(!clks)) if (WARN_ON(!clks)) Loading Loading @@ -170,6 +170,8 @@ void __init of_cpu_clk_setup(struct device_node *node) kfree(cpuclk[ncpus].clk_name); kfree(cpuclk[ncpus].clk_name); clks_out: clks_out: kfree(cpuclk); kfree(cpuclk); cpuclk_out: iounmap(clock_complex_base); } } CLK_OF_DECLARE(armada_xp_cpu_clock, "marvell,armada-xp-cpu-clock", CLK_OF_DECLARE(armada_xp_cpu_clock, "marvell,armada-xp-cpu-clock", Loading
drivers/clk/mvebu/common.c +12 −6 Original line number Original line Diff line number Diff line Loading @@ -45,8 +45,10 @@ void __init mvebu_coreclk_setup(struct device_node *np, clk_data.clk_num = 2 + desc->num_ratios; clk_data.clk_num = 2 + desc->num_ratios; clk_data.clks = kzalloc(clk_data.clk_num * sizeof(struct clk *), clk_data.clks = kzalloc(clk_data.clk_num * sizeof(struct clk *), GFP_KERNEL); GFP_KERNEL); if (WARN_ON(!clk_data.clks)) if (WARN_ON(!clk_data.clks)) { iounmap(base); return; return; } /* Register TCLK */ /* Register TCLK */ of_property_read_string_index(np, "clock-output-names", 0, of_property_read_string_index(np, "clock-output-names", 0, Loading Loading @@ -134,7 +136,7 @@ void __init mvebu_clk_gating_setup(struct device_node *np, ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); if (WARN_ON(!ctrl)) if (WARN_ON(!ctrl)) return; goto ctrl_out; spin_lock_init(&ctrl->lock); spin_lock_init(&ctrl->lock); Loading @@ -145,10 +147,8 @@ void __init mvebu_clk_gating_setup(struct device_node *np, ctrl->num_gates = n; ctrl->num_gates = n; ctrl->gates = kzalloc(ctrl->num_gates * sizeof(struct clk *), ctrl->gates = kzalloc(ctrl->num_gates * sizeof(struct clk *), GFP_KERNEL); GFP_KERNEL); if (WARN_ON(!ctrl->gates)) { if (WARN_ON(!ctrl->gates)) kfree(ctrl); goto gates_out; return; } for (n = 0; n < ctrl->num_gates; n++) { for (n = 0; n < ctrl->num_gates; n++) { const char *parent = const char *parent = Loading @@ -160,4 +160,10 @@ void __init mvebu_clk_gating_setup(struct device_node *np, } } of_clk_add_provider(np, clk_gating_get_src, ctrl); of_clk_add_provider(np, clk_gating_get_src, ctrl); return; gates_out: kfree(ctrl); ctrl_out: iounmap(base); } }