diff options
Diffstat (limited to 'drivers/clk/ti')
-rw-r--r-- | drivers/clk/ti/apll.c | 9 | ||||
-rw-r--r-- | drivers/clk/ti/clk-814x.c | 1 | ||||
-rw-r--r-- | drivers/clk/ti/dpll.c | 13 |
3 files changed, 12 insertions, 11 deletions
diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c index 015a657d3382..ac5bc8857a51 100644 --- a/drivers/clk/ti/apll.c +++ b/drivers/clk/ti/apll.c @@ -140,6 +140,7 @@ static void __init omap_clk_register_apll(void *user, struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw); struct dpll_data *ad = clk_hw->dpll_data; struct clk *clk; + const struct clk_init_data *init = clk_hw->hw.init; clk = of_clk_get(node, 0); if (IS_ERR(clk)) { @@ -168,15 +169,15 @@ static void __init omap_clk_register_apll(void *user, clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, node->name); if (!IS_ERR(clk)) { of_clk_add_provider(node, of_clk_src_simple_get, clk); - kfree(clk_hw->hw.init->parent_names); - kfree(clk_hw->hw.init); + kfree(init->parent_names); + kfree(init); return; } cleanup: kfree(clk_hw->dpll_data); - kfree(clk_hw->hw.init->parent_names); - kfree(clk_hw->hw.init); + kfree(init->parent_names); + kfree(init); kfree(clk_hw); } diff --git a/drivers/clk/ti/clk-814x.c b/drivers/clk/ti/clk-814x.c index e8cee6f3b4a0..087cfa75ac24 100644 --- a/drivers/clk/ti/clk-814x.c +++ b/drivers/clk/ti/clk-814x.c @@ -66,6 +66,7 @@ static int __init dm814x_adpll_early_init(void) } of_platform_populate(np, NULL, NULL, NULL); + of_node_put(np); return 0; } diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c index 659dadb23279..247510e306e2 100644 --- a/drivers/clk/ti/dpll.c +++ b/drivers/clk/ti/dpll.c @@ -165,6 +165,7 @@ static void __init _register_dpll(void *user, struct clk_hw_omap *clk_hw = to_clk_hw_omap(hw); struct dpll_data *dd = clk_hw->dpll_data; struct clk *clk; + const struct clk_init_data *init = hw->init; clk = of_clk_get(node, 0); if (IS_ERR(clk)) { @@ -196,15 +197,15 @@ static void __init _register_dpll(void *user, if (!IS_ERR(clk)) { of_clk_add_provider(node, of_clk_src_simple_get, clk); - kfree(clk_hw->hw.init->parent_names); - kfree(clk_hw->hw.init); + kfree(init->parent_names); + kfree(init); return; } cleanup: kfree(clk_hw->dpll_data); - kfree(clk_hw->hw.init->parent_names); - kfree(clk_hw->hw.init); + kfree(init->parent_names); + kfree(init); kfree(clk_hw); } @@ -291,14 +292,12 @@ static void __init of_ti_dpll_setup(struct device_node *node, struct dpll_data *dd = NULL; u8 dpll_mode = 0; - dd = kzalloc(sizeof(*dd), GFP_KERNEL); + dd = kmemdup(ddt, sizeof(*dd), GFP_KERNEL); clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); init = kzalloc(sizeof(*init), GFP_KERNEL); if (!dd || !clk_hw || !init) goto cleanup; - memcpy(dd, ddt, sizeof(*dd)); - clk_hw->dpll_data = dd; clk_hw->ops = &clkhwops_omap3_dpll; clk_hw->hw.init = init; |