diff options
author | Emilio López <emilio@elopez.com.ar> | 2013-12-22 22:32:40 -0500 |
---|---|---|
committer | Emilio López <emilio@elopez.com.ar> | 2013-12-28 15:08:25 -0500 |
commit | 76192dc8873f724361c1bf8a90b37abc7dfed7ad (patch) | |
tree | 9cdae88195f079955485df8fc290a955f5a97bb1 | |
parent | 7551769a225f3e600d6455e63ae00d51df37ff59 (diff) |
clk: sunxi: support better factor DT nodes
The DT nodes should look like
abc_clk: clk@deadbeef {
...
clock-output-names = "abc";
}
But our old DT nodes look like
abc: abc@deadbeef {
...
}
So, let's support both formats, until we can transition everything
to the new, correct one.
Signed-off-by: Emilio López <emilio@elopez.com.ar>
Acked-by: Mike Turquette <mturquette@linaro.org>
-rw-r--r-- | drivers/clk/sunxi/clk-sunxi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index 75fbc48129be..124113e33f06 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c | |||
@@ -441,6 +441,15 @@ static struct clk * __init sunxi_factors_clk_setup(struct device_node *node, | |||
441 | (parents[i] = of_clk_get_parent_name(node, i)) != NULL) | 441 | (parents[i] = of_clk_get_parent_name(node, i)) != NULL) |
442 | i++; | 442 | i++; |
443 | 443 | ||
444 | /* Nodes should be providing the name via clock-output-names | ||
445 | * but originally our dts didn't, and so we used node->name. | ||
446 | * The new, better nodes look like clk@deadbeef, so we pull the | ||
447 | * name just in this case */ | ||
448 | if (!strcmp("clk", clk_name)) { | ||
449 | of_property_read_string_index(node, "clock-output-names", | ||
450 | 0, &clk_name); | ||
451 | } | ||
452 | |||
444 | factors = kzalloc(sizeof(struct clk_factors), GFP_KERNEL); | 453 | factors = kzalloc(sizeof(struct clk_factors), GFP_KERNEL); |
445 | if (!factors) | 454 | if (!factors) |
446 | return NULL; | 455 | return NULL; |