aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/mvebu
diff options
context:
space:
mode:
authorGregory CLEMENT <gregory.clement@free-electrons.com>2017-03-30 17:22:54 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2017-04-24 21:42:13 +0200
commitb92a3bcc7c3ca4ee8d228f033de32aefff3c74a4 (patch)
tree35edcf6bb9e9533a1e2e9c1ddd4606728fcf5ddb /drivers/clk/mvebu
parentclk: apn806: Add eMMC clock to system controller driver (diff)
downloadlinux-dev-b92a3bcc7c3ca4ee8d228f033de32aefff3c74a4.tar.xz
linux-dev-b92a3bcc7c3ca4ee8d228f033de32aefff3c74a4.zip
clk: apn806: Turn the eMMC clock as optional for dts backwards compatible
First version of the binding didn't have the eMMC clock. This patch allows to not registering the eMMC clock if it is not present in the device tree. Then the device tree can be backwards compatible. Suggested-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/clk/mvebu')
-rw-r--r--drivers/clk/mvebu/ap806-system-controller.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c
index 901d89c4ab4a..103fe18a3c29 100644
--- a/drivers/clk/mvebu/ap806-system-controller.c
+++ b/drivers/clk/mvebu/ap806-system-controller.c
@@ -136,13 +136,19 @@ static int ap806_syscon_clk_probe(struct platform_device *pdev)
}
/* eMMC Clock is fixed clock divided by 3 */
- of_property_read_string_index(np, "clock-output-names",
- 4, &name);
- ap806_clks[4] = clk_register_fixed_factor(NULL, name, fixedclk_name,
- 0, 1, 3);
- if (IS_ERR(ap806_clks[4])) {
- ret = PTR_ERR(ap806_clks[4]);
- goto fail4;
+ if (of_property_read_string_index(np, "clock-output-names",
+ 4, &name)) {
+ ap806_clk_data.clk_num--;
+ dev_warn(&pdev->dev,
+ "eMMC clock mising: update the device tree!\n");
+ } else {
+ ap806_clks[4] = clk_register_fixed_factor(NULL, name,
+ fixedclk_name,
+ 0, 1, 3);
+ if (IS_ERR(ap806_clks[4])) {
+ ret = PTR_ERR(ap806_clks[4]);
+ goto fail4;
+ }
}
of_clk_add_provider(np, of_clk_src_onecell_get, &ap806_clk_data);