Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750890AbbGGEGM (ORCPT ); Tue, 7 Jul 2015 00:06:12 -0400 Received: from mail-bl2on0086.outbound.protection.outlook.com ([65.55.169.86]:56192 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751391AbbGGEFc (ORCPT ); Tue, 7 Jul 2015 00:05:32 -0400 Authentication-Results: spf=fail (sender IP is 66.35.236.236) smtp.mailfrom=opensource.altera.com; vger.kernel.org; dkim=none (message not signed) header.d=none; Authentication-Results: codeaurora.org; dkim=none (message not signed) header.d=none; From: To: , CC: , , , Dinh Nguyen , Maxime Ripard , =?UTF-8?q?Emilio=20L=C3=B3pez?= Subject: [PATCHv2 5/6] clk: sunxi: make use of of_clk_parent_fill helper function Date: Mon, 6 Jul 2015 22:59:05 -0500 Message-ID: <1436241546-16731-6-git-send-email-dinguyen@opensource.altera.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1436241546-16731-1-git-send-email-dinguyen@opensource.altera.com> References: <1436241546-16731-1-git-send-email-dinguyen@opensource.altera.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: BLUPR01CA060.prod.exchangelabs.com (25.160.23.50) To CY1PR03MB1375.namprd03.prod.outlook.com (25.163.16.29) X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1375;2:9WLETRnns4NkE1VJ8OeObuK+mdAvT5TC6POhBNt0kkF1w77GsH3Ob5SMI9aAEOtf;3:yf70QRqkYS/R40vrVe/HYOYYWxgK2yHAdoJeMQ22MxuhxYB0pCbRtSiieuOS00MQEYlub8sZ0hGQwU9GwSiqcfl97Spj08hVKAZmcy8BxAxIzjYpoj5pdfWlmpf4nBFr10mc3do5pA8n9zu3UylRmA==;25:TLCiuDUWbWuy7uwIkwR9eNmcxDVnqvQyjiIVdJGQg4w88ZALRYeyBTYK7fWb2KE0jU4PpDgTLZeK6mbibTZKp4NCBilTVisBSS7RHVGr6VdNd0OpYsxH3CA7LSG9NAokHy4Ad/4hbuguQNJhxBS/KL8MUkAdrWJ+5NmyaUWRlgjtB7M7Tg9xiXxiRt1mMnju5NeCIMAJfG8ggimGMwhYVoAHVhuSZHRqvrIw+8KEyW0ztArRKTD2OJhE/1n+9YaPWd+bK152IQQ2bjMwnRrzig==;20:o4RA1nV8Ca9G198uJg7qBoGL1STmzttjVoKLNHAmosSASozqwLJq+705W9y9DxkDtFbw3iaaUlTwKWuybRlZIGp6PoXnqY9zkbtiukwy9SjXw5Vut4MWD7Y56I7KerQPT3bgnSaP++Ef7gJecKhN7jRX1GYHlunPHBL7AFqJgz4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1375;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB234; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:;UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR03MB1375;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1375;BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN1PR03MB234;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB234; X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1375;4:0itPkn7hEzaMJg07dgRw2HXnORdj1NUQEWZCIrClHKcTivIquf1JbCmm1NtnvX+bx1oKMoyN/bc5oBY2eshrdqlTg3DKStVDo83wG6TF9kOkV8H1xUFbIJcYNtzFiUqk6EqrbhpNJmoele2Katgq4w8iE8OI+NU/FyoWLJKh/TymHU/dQX3W6eSO6snR6k+10Ldl0uemNUDwAH/l5aWxw5YTzaJfJttdETSe0wruAmmebQg2eQqYFa13NHaR6PFdZudxxjQaobgi3Mbsj+bfxQgJ3dOwQJjGgQze3BDwiH8= X-Forefront-PRVS: 0630013541 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(6009001)(19580395003)(92566002)(189998001)(66066001)(23676002)(77096005)(122386002)(62966003)(40100003)(87976001)(5001770100001)(50466002)(77156002)(42186005)(5820100001)(50226001)(50986999)(5001960100002)(5001920100001)(86152002)(2950100001)(76176999)(19580405001)(46102003)(33646002)(53416004)(229853001)(47776003)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR03MB1375;H:linux-builds1.altera.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1375;23:Vsz0DSmi9XjUsz4KgXUtt7UzUCTnc/cr7x9LRRfTtk/V0FJSYCThf65v1Kg3y/asbXMdnJ8d4CBLj0b8zrvXXSh42m0PwZJ37PFSiH3nvM3ZN89cgj4ZHw2Ia98qekjQMFoU6HaQC1pztC/BkL3K3euHMtFvoYl5rvG+eNyT0DewSUVjGa5ofrYxI1h8YFVMEqDCE4Yd1auDHqWy13oahlhmK5mN6pBTfezVgGownfOQyL+/DZy7xMKIRhldbkbdbz8E16kTO0uyk9i2TzfShjs8La3o2l3zQy+FcKLn/l7XyZWe/YBVggbWoaTPFHMk8/is3mTpVwJWbDr+AbL/s7o9G2XC8eFD1dE8ydJr+KC+sFsIlWRuDNAUVIYEkHsEm+9tW9t68n/DeA+qbSosN0b7ytD+YxzwuxhNTKqb59gkzv6lK+xCXTGPC+V/80LVsovGepZj32OdfP40RWTvVJHo2C0T8yIMSHJipj8BEVBTGFywO5twyrhwCGIWA2MPjq/PdsRoVaz19Uez6M9Lva3kz7mGMAet4NKIcXsNgTHsT6kqDXG5RrhQQXF0Ez9QqI5zsd96ROwvb8klrn0T3WgO3ShqEel7mTMMQ3JXbSLOYu10Me9UWn2tV0JCAXuML1dDeZYSF+jJ65E4E1BQ0E8rMqoMjmcKoUKg1X0ipd+gTQsYiUO1UtY1FaGlkRDY3t6c9NVuMPsgec0rnhKiHnrIKdW0r61akxkK20lDb5JoRQn3oUu3M8rCyrXoKr2f2ZqCfngFvxNAjcKSYtkJf5KtIIca77keZSlPMupwz9phq84YDTxtvBBnjdsIEotQ1QXUVAbewEasAgtt/16I5eUd4z6xRYuFW3vUohIL94I= X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1375;5:GsHOsCdx3+RE2gNYBlA8tVFEO7tNeeoEOSaFKuiRhhxXRZmNtM6j1KVjZFiSzqp2ghJs2t/bL2prnBHZQJGNRoDyoJm65pqcZZSdfJo/IxxGbrSei3I43/eXXoPV66KPNTd4uAA66GnbGOQ2obMmhQ==;24:VOg8ISDsAtHv3Zg96ZSe89XLo/B8PwZ5t4mpv3HUkc3Zr3MDGm8bvnrqYnsBLntLbWaurGgKlwEuss3TE8xVRMcvgx8NqpQh0sw1K3bb7o8=;20:bZp7TtVK2ci4og/6edF+FGf5UirLGNfGgGE1p7c2NaEtOwyU+FK4i7OAIkqQCGk9W9vNYkUL+/pawjatINkn7syXQ3najmVGRXkRcHauAX/kLimAHLinj4ftb2cwWrU4hQlsJF8gTao5txGyRBgZ6xHaqF9m4WUrNmTc1ofqeq4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1375 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BN1BFFO11FD013.protection.gbl X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD013;1:moyOHx3UVm3blhiJK0yXL5V5+BthEdYM6sqyRn6n3LZdm2ApTuMetqffw98hOL2x7FA9GYL1yApeTX+dSKDWihCqUaC8VORnSlX9CQv8SyG4601MbNTP0WZu6/J0Pwk/mbZttNNrvAPEGWt682525FEeqn/lr7bmuGQkVul2c1mwLYBCFsMG27AiChzOaje1gJZKuy9WHKElnNMv9I3Lelye3rwCK0I6jvp0QfLBKFbWaqwnhv77daGJxuTFIEZYaYuTkHtNhNh5zFwXlw5jOZ/b4N5Ar3eZCe66LniVO5Mz6/YqlGGu1AGqJeysygcb X-Forefront-Antispam-Report: CIP:66.35.236.236;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(339900001)(5001960100002)(189998001)(76176999)(53416004)(77096005)(50986999)(2950100001)(50466002)(105606002)(5001770100001)(62966003)(77156002)(92566002)(50226001)(40100003)(106466001)(87936001)(5820100001)(86152002)(229853001)(23676002)(86362001)(122386002)(85426001)(6806004)(19580395003)(33646002)(19580405001)(66066001)(47776003)(46102003)(16796002)(7099028);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1PR03MB234;H:sj-itexedge04.altera.priv.altera.com;FPR:;SPF:Fail;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB234;2:tnNMTgcO6DKnrxd4pQTSUuVyaBWbjNt3E8FbdS2P6kqcjpnzPaMveZswrn40Y6TH;3:e1t3Q7gEy03VxxQu3IPor54d68OFXAYHx3/8rUJDpc75Fi1ZTennbF01sG2aXs2Lzqr5+X5sn4o1+FjRsPMBhEdDMdkVMJspWsrX88h7uzWsqjsTb5bPmmZArH2Q2g5lMMeSDZUM42trXXwbd0EdSK2WdS6bzpZKS1Mhp+zNVNm6UpAWkt3cvuAocQBFCoNDvWIr6pbcCvx/APwT0OigXgfiGnSNPx+bktZO+hub8jc=;25:VX3I+0SMzZrqG+xuROKOHjLOxO7ZUVduvGfkXhgJSQ6wkRRuOckSy5Laey341RSJK1Zi02UvkvGWpiiIIzo2fLFBb83quc92FrizT04TtDXho1yvqX+nmCqB7cW2Ew7DbUaSebB7PkCFYbyRyFPt6q1RZBAG1dW1Pgi8Mlqr8TWQSbHUmugsB5UBLLCqaDXVlnw4PXbok9sQmHOpdpvBuwLM1+UGzfSzFgyib5D0Or9ZViz1gkjzk+z+zApTtpwZb/pUzcFOWIolyKUbBNE/Vg==;20:OeghnRxT68TJwOAL1+WFtTETE6JoPsNfkASHEZE0Qontoo/8wOp/JxPqomAG/XNWbufqMno4uDdSyR238ritbk6DX2js0IJeWNEHkPE84kuMhhBOlNVsfuG2wNp+OeLDKm0hlem80K70Y24Q+9p6rQmBrGxmJ3od0JmVHGzR0BQ= BN1PR03MB234: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB234;4:ffE4hZubJYROf2fKr/PCJHzIZH4cAKk2yP6aKrfMD4M8Iva3ZBVgvjpjgvjWtoq/J36ZVe+P+5lozHTuY8tSYxkBWo3LakpVe8fC89kCT/7W7QrXl54inLrbDdxU0K1uN9/CGAQ+8LQcll+oYI5XvMNKD0KzqE5tURU4hZ/rX/X8VbpW5lkSHp0sHTbIqnIiqfQyOguTgzRT1d2ah+xVXS8px1gMS098+eeRoMl8TSBvMP3ZmIQcHuxxhSwTCT4iCrSCZN0/1LkkU4ruU2m/IYwl4abSGe5V7p+iVvVedRU= X-Forefront-PRVS: 0630013541 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjFQUjAzTUIyMzQ7MjM6SzUwMTNSWHVQUEdnSVhVdE11NWdpcXpNZkp5?= =?utf-8?B?TmxxcFNvWTZWVnIwTGFzQXdZY09sTzhlVDdtdS84cmVrbHJCbTNvT1RPMU5W?= =?utf-8?B?MU1Cc1hvams5WitlOGtZdjNQaDJuNWhod3h0SXFsSGl4R0wvbXBuaW5zRS9i?= =?utf-8?B?aXMrelVZSjIrK2drN2VPZXl6a2ZNcXdzUzlrQm5FeUYzRUMxTEI5T3VFQVI4?= =?utf-8?B?SldGK2dLYnhMWmJGd0lDZ3BxMjJmZkEzRDZkNFZsQWVnZ2RuVkcydHRPV2g1?= =?utf-8?B?Z0s1bG9pWGJ5SXRlNkdBYUx3MndjRDQ0MVBLT3dqalF4Q2IrbGtPazFPenc5?= =?utf-8?B?KzNobnBzUlk5WUw4NndqcC94KzJqL1dsVDZxS0U5U2oyKzNDYW1RZjNwa2wr?= =?utf-8?B?S0tlRTZQRFVsa08wTXgxUU56N0M2aUxKWU1G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QkJ0UT09?= X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB234;5:1jhAx+R5PogkR4cqnKsUABLmvvgysyO2gipLZ8Ymnl2lmk5TC7LEi5LmWAOViUGmykocCCik/CTghNOU5DDQvtWfXOxTvGJKgNgLjI/9RyKhEr1YXzlhnF2qO+3cA5LNq4cBYVg+xZkOG1V+pHRb8Q==;24:y10XoPaJfQxem3lWnUKC+w21WJirB3JR5QG0f/E6F1gpE1TQNHblcp3Ex9vvP9GBM3rCtykmTgR6bK2aXyiLLH/W5hsIFnZl1s3MEzS0i5I=;20:9QtnZRJctZcj/X8df/ddlD3whQUCKP/E7ST1RXZ4nt0Hu5R7x2Dn11Ln+xUT3Mqbx6vIm0xx7cdZreLEdbUyzbS0Yd65WqOY4PB7xFidfxqP9I8KnQeB1lt5SYlBj5EIcN8U9iH0w8Xr4X76FNjvQxAVpzaby1cT9v6X2CFv6v0= X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2015 04:05:29.2974 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a;Ip=[66.35.236.236];Helo=[sj-itexedge04.altera.priv.altera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR03MB234 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3606 Lines: 96 From: Dinh Nguyen Use of_clk_parent_fill to fill in the parent clock names' array. Signed-off-by: Dinh Nguyen Cc: Maxime Ripard Cc: "Emilio López" --- v2: Add if (of_clk_parent_fill(node, parents, 2) != 2) to clk-a20-gmac.c --- drivers/clk/sunxi/clk-a20-gmac.c | 4 +--- drivers/clk/sunxi/clk-factors.c | 4 +--- drivers/clk/sunxi/clk-sun6i-ar100.c | 3 +-- drivers/clk/sunxi/clk-sunxi.c | 10 ++-------- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/clk/sunxi/clk-a20-gmac.c b/drivers/clk/sunxi/clk-a20-gmac.c index 0dcf4f2..1611b03 100644 --- a/drivers/clk/sunxi/clk-a20-gmac.c +++ b/drivers/clk/sunxi/clk-a20-gmac.c @@ -80,9 +80,7 @@ static void __init sun7i_a20_gmac_clk_setup(struct device_node *node) goto free_mux; /* gmac clock requires exactly 2 parents */ - parents[0] = of_clk_get_parent_name(node, 0); - parents[1] = of_clk_get_parent_name(node, 1); - if (!parents[0] || !parents[1]) + if (of_clk_parent_fill(node, parents, 2) != 2) goto free_gate; reg = of_iomap(node, 0); diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-factors.c index 8c20190..2589457 100644 --- a/drivers/clk/sunxi/clk-factors.c +++ b/drivers/clk/sunxi/clk-factors.c @@ -174,9 +174,7 @@ struct clk *sunxi_factors_register(struct device_node *node, int i = 0; /* if we have a mux, we will have >1 parents */ - while (i < FACTORS_MAX_PARENTS && - (parents[i] = of_clk_get_parent_name(node, i)) != NULL) - i++; + i = of_clk_parent_fill(node, parents, FACTORS_MAX_PARENTS); /* * some factor clocks, such as pll5 and pll6, may have multiple diff --git a/drivers/clk/sunxi/clk-sun6i-ar100.c b/drivers/clk/sunxi/clk-sun6i-ar100.c index 63cf149..6f229ff 100644 --- a/drivers/clk/sunxi/clk-sun6i-ar100.c +++ b/drivers/clk/sunxi/clk-sun6i-ar100.c @@ -195,8 +195,7 @@ static int sun6i_a31_ar100_clk_probe(struct platform_device *pdev) if (nparents > SUN6I_AR100_MAX_PARENTS) nparents = SUN6I_AR100_MAX_PARENTS; - for (i = 0; i < nparents; i++) - parents[i] = of_clk_get_parent_name(np, i); + of_clk_parent_fill(np, parents, nparents); of_property_read_string(np, "clock-output-names", &clk_name); diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index 9a82f17..eed66f8 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c @@ -202,10 +202,7 @@ static void __init sun6i_ahb1_clk_setup(struct device_node *node) return; /* we have a mux, we will have >1 parents */ - while (i < SUN6I_AHB1_MAX_PARENTS && - (parents[i] = of_clk_get_parent_name(node, i)) != NULL) - i++; - + of_clk_parent_fill(node, parents, SUN6I_AHB1_MAX_PARENTS); of_property_read_string(node, "clock-output-names", &clk_name); ahb1 = kzalloc(sizeof(struct sun6i_ahb1_clk), GFP_KERNEL); @@ -790,10 +787,7 @@ static void __init sunxi_mux_clk_setup(struct device_node *node, reg = of_iomap(node, 0); - while (i < SUNXI_MAX_PARENTS && - (parents[i] = of_clk_get_parent_name(node, i)) != NULL) - i++; - + of_clk_parent_fill(node, parents, SUNXI_MAX_PARENTS); of_property_read_string(node, "clock-output-names", &clk_name); clk = clk_register_mux(NULL, clk_name, parents, i, -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/