]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clk: ti: clkctrl: replace dashes from clkdm name with underscore
authorTero Kristo <t-kristo@ti.com>
Thu, 30 Aug 2018 06:58:31 +0000 (09:58 +0300)
committerTero Kristo <t-kristo@ti.com>
Wed, 3 Oct 2018 12:02:26 +0000 (15:02 +0300)
The change in the DTS data node naming prevents using underscore
within the node names and force usage of dash instead. On the other
hand, clockdomains use underscore instead of dash, so this must be
replaced within the driver code so that the mapping between the two
can be done properly.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
drivers/clk/ti/clkctrl.c

index 9bff57f0345d29d859bbd86869d1f7929080685a..e4b431b63e6b2524371046a3370af855073f2a9f 100644 (file)
@@ -445,6 +445,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
        const __be32 *addrp;
        u32 addr;
        int ret;
+       char *c;
 
        if (!(ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT) &&
            !strcmp(node->name, "clk"))
@@ -532,6 +533,15 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
 
        strcat(provider->clkdm_name, "clkdm");
 
+       /* Replace any dash from the clkdm name with underscore */
+       c = provider->clkdm_name;
+
+       while (*c) {
+               if (*c == '-')
+                       *c = '_';
+               c++;
+       }
+
        INIT_LIST_HEAD(&provider->clocks);
 
        /* Generate clocks */