Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932235AbbFAVw5 (ORCPT ); Mon, 1 Jun 2015 17:52:57 -0400 Received: from mail-bl2on0096.outbound.protection.outlook.com ([65.55.169.96]:45926 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932168AbbFAVw1 (ORCPT ); Mon, 1 Jun 2015 17:52:27 -0400 Authentication-Results: spf=fail (sender IP is 66.35.236.236) smtp.mailfrom=opensource.altera.com; codeaurora.org; dkim=none (message not signed) header.d=none; Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=dinguyen@opensource.altera.com; From: To: , CC: , , , Dinh Nguyen Subject: [RFC/PATCHv1 2/2] clk: socfpga: make use of of_clk_parent_fill helper function Date: Mon, 1 Jun 2015 16:46:26 -0500 Message-ID: <1433195186-14867-3-git-send-email-dinguyen@opensource.altera.com> X-Mailer: git-send-email 2.2.1 In-Reply-To: <1433195186-14867-1-git-send-email-dinguyen@opensource.altera.com> References: <1433195186-14867-1-git-send-email-dinguyen@opensource.altera.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: BY1PR0501CA0006.namprd05.prod.outlook.com (25.162.139.16) To CY1PR03MB1373.namprd03.prod.outlook.com (25.163.16.27) X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1373;2:hD1gLvSpWtDtTP7bL5ycdYNzsPYGwrYZsCMJzEsmt/aDEn2mcUIgo8/EKL8vfZQd;2:PZbVebRy3JBwwbDs9cbUVqDtkOpY/i0UGsS70OOnGB98FB/VD7U1ZjFxkq8CyFpG9xu467sfLgdhRosbCSzJucKWfWQePy3JSPzOUPhjdHtorKu4Wv69zGlUc+wemVs1SHXDRbQHghtwUGuAIL1g9Q==;6:xBDWj2ORmwTmt8kyM/vqmRKY/xKbTRXcTqzrz0Km9Z5xEn7FhtDol95O1ymjdyfJbrjSeyF3JmthbhVTcEXYkQBYRmFYjgbuanAj7zStdgAg5t5uemDqxU7PMDAzCNcVf6N36hpua5GMen/ywfWl4w==;3:uv6c+gifewiXy9mcfzS/3DOnLrgpa1F4TL4k7DXDDau1ybHQky0RPKvHWus7LqOOLZgcerErDHnXJ0g+ovGYMYSxclq16XZDBJIr/LFbpxggOhTWd5SO28oR0/S9kbeJYhu2OY7zfVwePwCUfcKBq/JlgW3xJPxGVy047yoJlwUHe6zih0cko9TEHT8X0Ycc+CK9PTKmNfu9VD6d1ssssqinSFRAsoZwKzeTR+DHx1izf+Zwy7WeaRUtMxXhVmHmQ4sEPJQSWeei07HpTBtteyoJ9cRU6ifFeOkjp9QX2NqdEJtI1F1BU3fVewql+VDm X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1373;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB236; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:;UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:CY1PR03MB1373;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1373;BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:BN1PR03MB236;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB236; X-Forefront-PRVS: 05947791E4 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(6009001)(189002)(199003)(86152002)(19580405001)(105586002)(106356001)(86362001)(68736005)(47776003)(92566002)(48376002)(77096005)(64706001)(62966003)(5001830100001)(5001860100001)(2950100001)(107886002)(50226001)(5001960100002)(77156002)(189998001)(53416004)(46102003)(97736004)(50466002)(50986999)(5001770100001)(122386002)(81156007)(40100003)(229853001)(76176999)(66066001)(4001540100001)(19580395003)(42186005)(87976001)(101416001)(33646002)(69596002)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR03MB1373;H:linux-builds1.altera.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:0;LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: =?us-ascii?Q?1;CY1PR03MB1373;9:OPrErqW1Vp6faPSLHb95tp9ZctAfv1rrUqkTs0wOlL?= =?us-ascii?Q?ZYIrt+QDa+jqj1mrHlkPHSqV+slpo5CPO5ZlbPC9QLLv5gjPxaVkE0kwQbg2?= =?us-ascii?Q?o2me84uRiFMHeAOvHXSIzgYFBoGbg8ywxEuuonCUxkKtG5RI4vf1j8jlGQ0z?= =?us-ascii?Q?Kn/nqv3Wu9AbDZ4Z/CwT8Rp+8B4HrenATGfPETopggNN2+OyVjOqrlxVPxSq?= =?us-ascii?Q?BtG+RGgW0aG8JNO0BPsTRU5Af3hQFI3lwZ2tKrAU5/qQq/YeAOO6X4maxRK1?= =?us-ascii?Q?g0axdefw8byu+6w/lDnNd2bD1w3AeP0UI7Pqa2PRccxeHLi21OBmFsBB02JQ?= =?us-ascii?Q?QahZ9ydjhooz/SvZnDTaMkkrnahT+Ic+djupM073/N2p+JuzR6DFsLFIdLM5?= =?us-ascii?Q?XXn93z7YUkNWtg8bF6limGrjXwLPC0vYUAqEhz0cI9x/qCsPUzd4wdlMYFMO?= =?us-ascii?Q?kwSeF3VuTIcwXYGuwOfNUngNrPx5NvcEqcOUWwRxmAWzQgQ+78m+uCeyiKd+?= =?us-ascii?Q?4r3jStN/hCZrwigiGuY6Mv4qhG3dHcXCL87eOwoghJ6cd5hiwVWXXgMxuceG?= =?us-ascii?Q?i7TlaY+3pSRVTYqo60X/vYfQIr/UY8wLw4IzptOP9RxRLzQIsAOH3U0CStKV?= =?us-ascii?Q?OWIP4zNjcgHWPhx8M/LMaFVow5kz5PDhieIkvWM2HtnLbP071XHaTT+sZaq4?= =?us-ascii?Q?qk+GTOp9SBRMlvE0ciWOqLcq2S0E3XJxpsvt5uBvfnCT/8XhbuGMUXV/4BYe?= =?us-ascii?Q?30ZACGFVj3nE9p4sZvJWhXUnfzKnvALKuIPT59k0od/ETyMTEu046QoJimWc?= =?us-ascii?Q?0lpcG76WuwVwsMCepY8pjxMB6NTPK4vWwr+soIxeZNZs4YaerI/XKiajBzwQ?= =?us-ascii?Q?SEz8aMj8AD627MArye0a5xmnBnhFoXWe3/3+gtMqWYCnqYStRsv609KDwERM?= =?us-ascii?Q?vESqJVVEJ1rWlqjaC888Lg08SC3APW3a2MfIsNO0O/yz9e/FWR0Uoh0FUbAX?= =?us-ascii?Q?5gdeO5IdEHidwJ5tn5Fe+5xnjNOKFm43OyU5TOVkIldkxxDhlhDh5yjyHE7c?= =?us-ascii?Q?4lVZx9/d8LbkDuXqigAicGMJVUolAaivP1ygLXkQmf6eJvkJ8W3w/Ah7iBib?= =?us-ascii?Q?qXQvfOe5/3Zj/VG5z121kVwvk5S/af?= X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1373;3:xCv5GfYO0AA5qw8tOTWvng/XvzQbi0u1gFRY0H1jFxHXWcyOlD5nyx4LdFhcXqvZR7Ao5+QTR03IvMPIk/NtmYwrJtGCNtfe41vIZ7aiMK+n4YzQ7qlqOKsjFfoLOMVztaHf4uWRdBQpPZRSAFd67Q==;10:PAVbkCUo2fG9ocs36+wgvxa6l4UzKT8jL3oXdORFCXNu/cYzFRQQ0fcjvdACtnKUD026TkQmj3CSrbjbSyE9hF041odJQk8v+DgYNid1zlE=;6:aC9I4l8MW//S6Ygb1yy4gAzsxg3pJVxcJmHnQlj3p+gGeU9Oc84WAi3k7ldHPNdo4MWfY2wVV+6LihHRdaw7BfrO6a72D/EVggMB8+Eo1gLeLy3Ptsc+KCRgdlqK/MM5W+LaaNoJsZBeWmXhARHGkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1373 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BY2FFO11FD013.protection.gbl X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD013;1:/SP6ieRTI3K3ocHmw3jie0Vb4KCnFxnN2nIyF877q11QmLPlewQsQwhzEt+/4HSaU3q8syJwn0Bx8+BxnU3f3i1zhu5zTj/fIvc0l6w8IWhJIHppTmEhNphhe4O4tJ9RPXfVEE08NER1mA6LRdADKMAnGrEZcNMuCDsr/eIPk+mCLdTYV9UjIliownFOXvc5gDXEaS3Y2iUAwHi9zhxfuwb6tFNjebtzsmwDfPAp+Ll5YkOP2WUN8sAzlGqis/Q+RAqf+ByYjbmr7DaRANXc4A== X-Forefront-Antispam-Report: CIP:66.35.236.236;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(189002)(199003)(105606002)(6806004)(77156002)(53416004)(76176999)(77096005)(66066001)(40100003)(64706001)(50986999)(47776003)(50466002)(46102003)(33646002)(106466001)(229853001)(122386002)(48376002)(4001540100001)(81156007)(6070500001)(97736004)(86362001)(87936001)(5001770100001)(2950100001)(68736005)(19580395003)(19580405001)(62966003)(50226001)(5001860100001)(16796002)(85426001)(86152002)(5001830100001)(5001960100002)(92566002)(107886002)(189998001)(7099028)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1PR03MB236;H:sj-itexedge04.altera.priv.altera.com;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:0;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB236;2:mcpYE3HkkxHgzgigWuBx9lX64pC1rbCQvAFg3JoPS/njQ0T+QkGTnI70p4LpXN2W;2:JAOVfpVdxV2n5sujtFmwJgBFR5J7CWIbOjzwv4iJDno8WdBHj4jeadlltwQnAndie5mHiEFXFH7Y6+gC/JmoxLWsbldFLHLdPQMz58qFFfY7oo9JsP3kYLEZb/bdNikPie8HjM/n8z9iEstk7qqCWUCenA2Y+OsN8CfiF7mmdVusAdqY0exPsR1WQRCSaE9qosBMBatLnExnEmoZlRDC5rIHZZsYBkTVvFsWrOW6aFY=;6:8e4/KaXllY7s3pkDGqK+fH5xUmzVBsKLjG6JevK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ippkku5tpehnN2ky1NX4tMexNPnUet3sWQ==;10:cv8p1X45iEGo5tFU7OC5OxSwlFLKud7h2tfU+4S2eLrwB2sXbjoVOyJzbJZ8qlNSKrtvl9ZYP/To4mXgqAgqBOUiXLJsGjjxdiELxKLfxcc=;6:XoGCaabqBDX/G/lBwiMEaZ+hzqBxC7fr8H5v/YEIcloSL2S5SyO4c7Y4QVpLoYjixQ0PQTpmHodCllCad8izlrHLx6wJJhl/WSzRwmIXlaHzOK4DkTGfIrxiVz9LWSQRRuQ55sH5gBlktfb5ks0zUw== X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2015 21:52:23.1160 (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: BN1PR03MB236 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2321 Lines: 69 From: Dinh Nguyen Use of_clk_parent_fill to fill in the parent clock's array. Signed-off-by: Dinh Nguyen --- drivers/clk/socfpga/clk-gate.c | 6 +----- drivers/clk/socfpga/clk-pll.c | 7 +------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/clk/socfpga/clk-gate.c b/drivers/clk/socfpga/clk-gate.c index dd3a78c..fb5a5d7 100644 --- a/drivers/clk/socfpga/clk-gate.c +++ b/drivers/clk/socfpga/clk-gate.c @@ -194,7 +194,6 @@ static void __init __socfpga_gate_init(struct device_node *node, const char *parent_name[SOCFPGA_MAX_PARENTS]; struct clk_init_data init; int rc; - int i = 0; socfpga_clk = kzalloc(sizeof(*socfpga_clk), GFP_KERNEL); if (WARN_ON(!socfpga_clk)) @@ -238,12 +237,9 @@ static void __init __socfpga_gate_init(struct device_node *node, init.name = clk_name; init.ops = ops; init.flags = 0; - while (i < SOCFPGA_MAX_PARENTS && (parent_name[i] = - of_clk_get_parent_name(node, i)) != NULL) - i++; + init.num_parents = of_clk_parent_fill(node, parent_name, SOCFPGA_MAX_PARENTS); init.parent_names = parent_name; - init.num_parents = i; socfpga_clk->hw.hw.init = &init; clk = clk_register(NULL, &socfpga_clk->hw.hw); diff --git a/drivers/clk/socfpga/clk-pll.c b/drivers/clk/socfpga/clk-pll.c index de6da95..8f26b52 100644 --- a/drivers/clk/socfpga/clk-pll.c +++ b/drivers/clk/socfpga/clk-pll.c @@ -92,7 +92,6 @@ static __init struct clk *__socfpga_pll_init(struct device_node *node, struct clk_init_data init; struct device_node *clkmgr_np; int rc; - int i = 0; of_property_read_u32(node, "reg", ®); @@ -111,11 +110,7 @@ static __init struct clk *__socfpga_pll_init(struct device_node *node, init.ops = ops; init.flags = 0; - while (i < SOCFPGA_MAX_PARENTS && (parent_name[i] = - of_clk_get_parent_name(node, i)) != NULL) - i++; - - init.num_parents = i; + init.num_parents = of_clk_parent_fill(node, parent_name, SOCFPGA_MAX_PARENTS); init.parent_names = parent_name; pll_clk->hw.hw.init = &init; -- 2.2.1 -- 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/