summaryrefslogtreecommitdiff
path: root/drivers/clk/shmobile/clk-mstp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-05-21 13:55:17 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-05-21 13:55:17 +0400
commit026d68be45a217f65f1617d08271f6838bfc07d7 (patch)
tree8c85cbd8c0aeb7899473173fff41cd595a3401c6 /drivers/clk/shmobile/clk-mstp.c
parentb2e3432af1546a9f44a8278a8a91abfbd439259e (diff)
parentd2c834abe2b39a2d5a6c38ef44de87c97cbb34b4 (diff)
downloadlinux-026d68be45a217f65f1617d08271f6838bfc07d7.tar.xz
Merge tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux
Pull clock framework fixes from Mike Turquette: "Clock framework and driver fixes, all of which fix user-visible regressions. As usual most fixes are for platform-specific clock drivers, but there are also two fixes to the clk core after recent changes to the way that clock unregistration is handled" * tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mike.turquette/linux: clk: tegra: Fix wrong value written to PLLE_AUX clk: shmobile: clk-mstp: change to using clock-indices clk: Fix slab corruption in clk_unregister() clk: Fix double free due to devm_clk_register() clk: socfpga: fix clock driver for 3.15 clk: divider: Fix best div calculation for power-of-two and table dividers clk: bcm281xx: don't use unnamed structs or unions
Diffstat (limited to 'drivers/clk/shmobile/clk-mstp.c')
-rw-r--r--drivers/clk/shmobile/clk-mstp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/clk/shmobile/clk-mstp.c b/drivers/clk/shmobile/clk-mstp.c
index 2e5810c88d11..1f6324e29a80 100644
--- a/drivers/clk/shmobile/clk-mstp.c
+++ b/drivers/clk/shmobile/clk-mstp.c
@@ -156,6 +156,7 @@ cpg_mstp_clock_register(const char *name, const char *parent_name,
static void __init cpg_mstp_clocks_init(struct device_node *np)
{
struct mstp_clock_group *group;
+ const char *idxname;
struct clk **clks;
unsigned int i;
@@ -184,6 +185,11 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
for (i = 0; i < MSTP_MAX_CLOCKS; ++i)
clks[i] = ERR_PTR(-ENOENT);
+ if (of_find_property(np, "clock-indices", &i))
+ idxname = "clock-indices";
+ else
+ idxname = "renesas,clock-indices";
+
for (i = 0; i < MSTP_MAX_CLOCKS; ++i) {
const char *parent_name;
const char *name;
@@ -197,8 +203,7 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
continue;
parent_name = of_clk_get_parent_name(np, i);
- ret = of_property_read_u32_index(np, "renesas,clock-indices", i,
- &clkidx);
+ ret = of_property_read_u32_index(np, idxname, i, &clkidx);
if (parent_name == NULL || ret < 0)
break;