Skip to content

Commit

Permalink
Merge branch 'clk-next-shmobile' into clk-next
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Turquette committed Jan 14, 2014
2 parents baa39cd + 209f4fe commit 119754e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/clk/shmobile/clk-mstp.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
unsigned int i;

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) {
kfree(group);
kfree(clks);
Expand All @@ -181,6 +181,9 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
return;
}

for (i = 0; i < MSTP_MAX_CLOCKS; ++i)
clks[i] = ERR_PTR(-ENOENT);

for (i = 0; i < MSTP_MAX_CLOCKS; ++i) {
const char *parent_name;
const char *name;
Expand All @@ -205,10 +208,11 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
continue;
}

clks[clkidx] = cpg_mstp_clock_register(name, parent_name, i,
group);
clks[clkidx] = cpg_mstp_clock_register(name, parent_name,
clkidx, group);
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
* clock by name and register aliases for non-DT
Expand Down

0 comments on commit 119754e

Please sign in to comment.