a3274819f805082328ad90b5ff6d7d82605f00d0
[openwrt/openwrt.git] / target / linux / sunxi / patches-3.13 / 114-clk-sunxi-clean-magic-number.patch
1 From 33574f94b0d4d8bc8af732fbcb4f911c3dd8c96b Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= <emilio@elopez.com.ar>
3 Date: Mon, 23 Dec 2013 00:32:33 -0300
4 Subject: [PATCH] clk: sunxi: clean the magic number of mux parents
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 This was pointed out during the review of the factor patches. Let's
10 indicate what does that magic 5 mean.
11
12 Signed-off-by: Emilio López <emilio@elopez.com.ar>
13 ---
14 drivers/clk/sunxi/clk-sunxi.c | 5 +++--
15 1 file changed, 3 insertions(+), 2 deletions(-)
16
17 --- a/drivers/clk/sunxi/clk-sunxi.c
18 +++ b/drivers/clk/sunxi/clk-sunxi.c
19 @@ -420,13 +420,14 @@ static void __init sunxi_mux_clk_setup(s
20 {
21 struct clk *clk;
22 const char *clk_name = node->name;
23 - const char *parents[5];
24 + const char *parents[SUNXI_MAX_PARENTS];
25 void *reg;
26 int i = 0;
27
28 reg = of_iomap(node, 0);
29
30 - while (i < 5 && (parents[i] = of_clk_get_parent_name(node, i)) != NULL)
31 + while (i < SUNXI_MAX_PARENTS &&
32 + (parents[i] = of_clk_get_parent_name(node, i)) != NULL)
33 i++;
34
35 clk = clk_register_mux(NULL, clk_name, parents, i,