summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorMike Turquette <mturquette@linaro.org>2014-01-14 23:41:26 +0400
committerMike Turquette <mturquette@linaro.org>2014-01-14 23:41:26 +0400
commit119754e57609113818f1226925046bfd54d6dc53 (patch)
tree988dc5d248718b4b3eee702b8aa40bad35c37f8e /drivers/clk
parentbaa39cd20ece9705e7e42015a1c7a898a36c31c8 (diff)
parent209f4fedcfdeeecfc9e87c045990230cc2162169 (diff)
downloadlinux-119754e57609113818f1226925046bfd54d6dc53.tar.xz
Merge branch 'clk-next-shmobile' into clk-next
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/shmobile/clk-mstp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/clk/shmobile/clk-mstp.c b/drivers/clk/shmobile/clk-mstp.c
index e576b60de20e..42d5912b1d25 100644
--- a/drivers/clk/shmobile/clk-mstp.c
+++ b/drivers/clk/shmobile/clk-mstp.c
@@ -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);
@@ -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;
@@ -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