Commit 119754e5 authored by Mike Turquette's avatar Mike Turquette

Merge branch 'clk-next-shmobile' into clk-next

parents baa39cd2 209f4fed
...@@ -160,7 +160,7 @@ static void __init cpg_mstp_clocks_init(struct device_node *np) ...@@ -160,7 +160,7 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
unsigned int i; unsigned int i;
group = kzalloc(sizeof(*group), GFP_KERNEL); group = kzalloc(sizeof(*group), GFP_KERNEL);
clks = kzalloc(MSTP_MAX_CLOCKS * sizeof(*clks), GFP_KERNEL); clks = kmalloc(MSTP_MAX_CLOCKS * sizeof(*clks), GFP_KERNEL);
if (group == NULL || clks == NULL) { if (group == NULL || clks == NULL) {
kfree(group); kfree(group);
kfree(clks); kfree(clks);
...@@ -181,6 +181,9 @@ static void __init cpg_mstp_clocks_init(struct device_node *np) ...@@ -181,6 +181,9 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
return; return;
} }
for (i = 0; i < MSTP_MAX_CLOCKS; ++i)
clks[i] = ERR_PTR(-ENOENT);
for (i = 0; i < MSTP_MAX_CLOCKS; ++i) { for (i = 0; i < MSTP_MAX_CLOCKS; ++i) {
const char *parent_name; const char *parent_name;
const char *name; const char *name;
...@@ -205,10 +208,11 @@ static void __init cpg_mstp_clocks_init(struct device_node *np) ...@@ -205,10 +208,11 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
continue; continue;
} }
clks[clkidx] = cpg_mstp_clock_register(name, parent_name, i, clks[clkidx] = cpg_mstp_clock_register(name, parent_name,
group); clkidx, group);
if (!IS_ERR(clks[clkidx])) { if (!IS_ERR(clks[clkidx])) {
group->data.clk_num = max(group->data.clk_num, clkidx); group->data.clk_num = max(group->data.clk_num,
clkidx + 1);
/* /*
* Register a clkdev to let board code retrieve the * Register a clkdev to let board code retrieve the
* clock by name and register aliases for non-DT * clock by name and register aliases for non-DT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment