]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
clk: sunxi: clean the magic number of mux parents
authorEmilio López <emilio@elopez.com.ar>
Mon, 23 Dec 2013 03:32:33 +0000 (00:32 -0300)
committerEmilio López <emilio@elopez.com.ar>
Sat, 28 Dec 2013 20:08:00 +0000 (17:08 -0300)
This was pointed out during the review of the factor patches. Let's
indicate what does that magic 5 mean.

Signed-off-by: Emilio López <emilio@elopez.com.ar>
Acked-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/sunxi/clk-sunxi.c

index 1c1172d6bdbe56e6652b17770b6fbad944731a27..bae5e32c51bdee8ec8b4d18e4b3f8e810b636c3b 100644 (file)
@@ -420,13 +420,14 @@ static void __init sunxi_mux_clk_setup(struct device_node *node,
 {
        struct clk *clk;
        const char *clk_name = node->name;
-       const char *parents[5];
+       const char *parents[SUNXI_MAX_PARENTS];
        void *reg;
        int i = 0;
 
        reg = of_iomap(node, 0);
 
-       while (i < 5 && (parents[i] = of_clk_get_parent_name(node, i)) != NULL)
+       while (i < SUNXI_MAX_PARENTS &&
+              (parents[i] = of_clk_get_parent_name(node, i)) != NULL)
                i++;
 
        clk = clk_register_mux(NULL, clk_name, parents, i,