diff options
author | Jisheng Zhang <jszhang@marvell.com> | 2013-08-22 22:34:01 -0400 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2013-08-23 14:44:03 -0400 |
commit | f98d007d332b819b7777bf280a07fc3d2dfe2f7a (patch) | |
tree | 536d498f579458def7a41c60dc74b132699349b3 /drivers/clk | |
parent | 89ac8d7ae1cde0f8c7a2f85c2e3b475d54aa9163 (diff) |
clk: mvebu: add missing iounmap
Add missing iounmap to setup error path.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/mvebu/clk-cpu.c | 4 | ||||
-rw-r--r-- | drivers/clk/mvebu/common.c | 18 |
2 files changed, 15 insertions, 7 deletions
diff --git a/drivers/clk/mvebu/clk-cpu.c b/drivers/clk/mvebu/clk-cpu.c index b0fbc0715491..1466865b0743 100644 --- a/drivers/clk/mvebu/clk-cpu.c +++ b/drivers/clk/mvebu/clk-cpu.c | |||
@@ -119,7 +119,7 @@ void __init of_cpu_clk_setup(struct device_node *node) | |||
119 | 119 | ||
120 | cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL); | 120 | cpuclk = kzalloc(ncpus * sizeof(*cpuclk), GFP_KERNEL); |
121 | if (WARN_ON(!cpuclk)) | 121 | if (WARN_ON(!cpuclk)) |
122 | return; | 122 | goto cpuclk_out; |
123 | 123 | ||
124 | clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL); | 124 | clks = kzalloc(ncpus * sizeof(*clks), GFP_KERNEL); |
125 | if (WARN_ON(!clks)) | 125 | if (WARN_ON(!clks)) |
@@ -170,6 +170,8 @@ bail_out: | |||
170 | kfree(cpuclk[ncpus].clk_name); | 170 | kfree(cpuclk[ncpus].clk_name); |
171 | clks_out: | 171 | clks_out: |
172 | kfree(cpuclk); | 172 | kfree(cpuclk); |
173 | cpuclk_out: | ||
174 | iounmap(clock_complex_base); | ||
173 | } | 175 | } |
174 | 176 | ||
175 | CLK_OF_DECLARE(armada_xp_cpu_clock, "marvell,armada-xp-cpu-clock", | 177 | CLK_OF_DECLARE(armada_xp_cpu_clock, "marvell,armada-xp-cpu-clock", |
diff --git a/drivers/clk/mvebu/common.c b/drivers/clk/mvebu/common.c index adaa4a1821b8..25ceccf939ad 100644 --- a/drivers/clk/mvebu/common.c +++ b/drivers/clk/mvebu/common.c | |||
@@ -45,8 +45,10 @@ void __init mvebu_coreclk_setup(struct device_node *np, | |||
45 | clk_data.clk_num = 2 + desc->num_ratios; | 45 | clk_data.clk_num = 2 + desc->num_ratios; |
46 | clk_data.clks = kzalloc(clk_data.clk_num * sizeof(struct clk *), | 46 | clk_data.clks = kzalloc(clk_data.clk_num * sizeof(struct clk *), |
47 | GFP_KERNEL); | 47 | GFP_KERNEL); |
48 | if (WARN_ON(!clk_data.clks)) | 48 | if (WARN_ON(!clk_data.clks)) { |
49 | iounmap(base); | ||
49 | return; | 50 | return; |
51 | } | ||
50 | 52 | ||
51 | /* Register TCLK */ | 53 | /* Register TCLK */ |
52 | of_property_read_string_index(np, "clock-output-names", 0, | 54 | of_property_read_string_index(np, "clock-output-names", 0, |
@@ -134,7 +136,7 @@ void __init mvebu_clk_gating_setup(struct device_node *np, | |||
134 | 136 | ||
135 | ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); | 137 | ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); |
136 | if (WARN_ON(!ctrl)) | 138 | if (WARN_ON(!ctrl)) |
137 | return; | 139 | goto ctrl_out; |
138 | 140 | ||
139 | spin_lock_init(&ctrl->lock); | 141 | spin_lock_init(&ctrl->lock); |
140 | 142 | ||
@@ -145,10 +147,8 @@ void __init mvebu_clk_gating_setup(struct device_node *np, | |||
145 | ctrl->num_gates = n; | 147 | ctrl->num_gates = n; |
146 | ctrl->gates = kzalloc(ctrl->num_gates * sizeof(struct clk *), | 148 | ctrl->gates = kzalloc(ctrl->num_gates * sizeof(struct clk *), |
147 | GFP_KERNEL); | 149 | GFP_KERNEL); |
148 | if (WARN_ON(!ctrl->gates)) { | 150 | if (WARN_ON(!ctrl->gates)) |
149 | kfree(ctrl); | 151 | goto gates_out; |
150 | return; | ||
151 | } | ||
152 | 152 | ||
153 | for (n = 0; n < ctrl->num_gates; n++) { | 153 | for (n = 0; n < ctrl->num_gates; n++) { |
154 | const char *parent = | 154 | const char *parent = |
@@ -160,4 +160,10 @@ void __init mvebu_clk_gating_setup(struct device_node *np, | |||
160 | } | 160 | } |
161 | 161 | ||
162 | of_clk_add_provider(np, clk_gating_get_src, ctrl); | 162 | of_clk_add_provider(np, clk_gating_get_src, ctrl); |
163 | |||
164 | return; | ||
165 | gates_out: | ||
166 | kfree(ctrl); | ||
167 | ctrl_out: | ||
168 | iounmap(base); | ||
163 | } | 169 | } |