Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754606AbbGGEGB (ORCPT ); Tue, 7 Jul 2015 00:06:01 -0400 Received: from mail-bl2on0053.outbound.protection.outlook.com ([65.55.169.53]:61478 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753939AbbGGEF2 (ORCPT ); Tue, 7 Jul 2015 00:05:28 -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 , Peter Griffin Subject: [PATCHv2 4/6] clk: st: make use of of_clk_parent_fill helper function Date: Mon, 6 Jul 2015 22:59:04 -0500 Message-ID: <1436241546-16731-5-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 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:Lgj4fHn7mvMG+yizorheBcL339aBzIxMXvBHBnGQGJJsBKMW0VX7fDBaHActWiYB;3:PY5Om78l3DINa/77rnf51db6kmED6zRF8v4nBeA/fzz6roJd6kfYiNC2dz5GbgEJsJa9Qi6MdqldAHteBcTs+Gm17MDGd1SBy2JHbB0RZDCH5fUYb9NvOt9ZE4DLiONurk/Zz0DwjArL+OQchLENlw==;25:NZCaJZYX0MrENnyufnr0tryEXrW1DpVZQauztTHFi0VTosODN7q0wPdUxhGCWADCTNMX3n+YYfgi33nzLpCViojfi/P/LC4wlFTLax/QbrIFGAUwzETeFCoWTvnK4wla/uxc7LyaPxvZuQ9qqDTxga981kQonOsBZGrmIDR7l8I9MVM3PXIZkpiYNfA+iVrkZv5J0XI2tdl9PzF654PIMkyWbGtiQySqjhoDnae2GepXU5YnYEvKiiYr4JPIHAoxEBPi8ICuDsMn+EShH7POsQ==;20:yG1/Uf6eC/X/iD5WEzXR+Qdq4MhGxWGsf5l/G4jhGMt+wgWgf9S3CXtdrBUHFFPhNTZHyKF7OSjAsEFRPT6IY+RT0waSp261jjBo/DSkRpS8pqxELoqcaL9t5Be+NOLDLFw/7XkNim2tUpStqve3dQ9cdC5GwnGjalZ5CVFlqQI= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1375;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB239; 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:BY2PR03MB239;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB239; X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1375;4:iOyv/H1sky04OUz6IIzU1lRu1XrQTmGpTAw+4D59hJl4svGplPoIUko/LHM0sKZtBS0hgOUCDe50BzgjcEuOxgWAA96UQ/iHdSYnOt48kqyZnybf4mWNRvc5gpOb4BS8wFgZ3gPmB7avyTy4ZlrwbwnctjOsLi0a2qs9uvsYlg+zo1SOwXh/amCSS9RUx9ps2aIr45xV+yygheZCf4sQvM181N1ZqizcgePA4SnIdjDRDgEPeAYpSIjERjBEwVq9cnKlSh49RhrDnqViv2NThQoAgvkHedWyS/v3MTR6G2w= X-Forefront-PRVS: 0630013541 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(6009001)(19580395003)(92566002)(189998001)(66066001)(77096005)(122386002)(62966003)(40100003)(87976001)(5003940100001)(5001770100001)(50466002)(77156002)(42186005)(50226001)(50986999)(5001960100002)(5001920100001)(86152002)(2950100001)(76176999)(19580405001)(46102003)(33646002)(53416004)(229853001)(47776003)(86362001)(48376002);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:Za9CmlO8XmcLc+uuH4WQlU+YkXbM1WE10HxL5ocXxXjZ6o2BZ1w+2uU16AHNZ9w3cGDNCx2AGrMxXzrwibmJ1b9b6zA3rwlbCdtHN+uYtfXUuUpdepdrdt2EKDmIS3VsfAyb5jrtv0rjvKeE7a97e68OHdQPScgKki9S1PkDTKpANqKXYL8Aln3fPHSmTfKXh8LqNVOH1A6knevhL/6gBwMnK9/se98djPDp8sftaM5QCch0hs2mIeeQBvaA1u8gD2mKpxP+GMN/DnrzrkkG2FN5VEfkLQT0psyJq4k+kKP6PNGQXepR7HNo1dqz0lCXZ2CsUXWnkJbir+dN+1ji444ZPbDPxKlhit5V9Od+zqlDTpfxj9S5BlwRxAbiSPTqixMV910KFdA1plK2+KCjQ/Er4Npat5yxg6PtX7lIHCe5wAWItG3vqdcc1dUnNUjDfc2E24pQlZpqaWaLqKQG95DVXtgF1pXI/Wbtxj8vaETC3aB8XYvU8ZNb8OuahMLUbzRckCVn7Bpv4FHeg5bUvE2iLBS9uJTWSx/LqnDwdeMAsoyCg9rQ5WHcrCMhEGtwc9RugctV3EnImMTbOsNioa3s39bOrSzpG70XRBaRK2smX8yk5kTrvhgJxmfbc3/z7Mxrhy9bgI5nojezyNJh+Ai4pC2Vtd7LWUrBOmN4Ma7qniqznI4990ITtDyLqdap068Fk6pydMRufpwUz5NUeI/WwCw6TkOMfDXbnAaynuKeKqhYWZArzV76NWU7AzU+FCPha6Cc2b72jtRhBRT3b0epdSvH2ThRzPlUnNZMFHmc4pE0vIlyhBmxKB3mfjpvTzGbUwXZDiRUoRlyaR3cJKMXeSDr+o9V/lYCMhM3tKw= X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1375;5:Uqx5IpL8NejirMyMnu5qy6UA3E631WjcuanV+8UxBP9VcPowROph73PoJfHsqaU9Ys4f/cdZWNx4IKEuYmXfa45oI9v6Q/nv78NONhsnK5zWX+zI1kVDy6lKU0AZnFiJnR4s11kNs4fzmn7wDUYvww==;24:pA2LrG3UB/8YL6vMut6wcvvJCsOLru1UGCmcixtCT7OwtY5QgbGZkE31fkvWVMlHcXywtLJbL39R44XYAIu1ih7j04Bd6kv1X1Ienh/PUCI=;20:63UYsLm7mql9WIf1RDVueeti0Co8le+ddxhvZwxQhI8ixg5Y9o3wDr2nPo1yU77xbR3MG65tTpQwNj6V5vnvVmaMBNgZaD2jWKdQBPyokUkF4HvnryMZAlqehtJ44tjlX3KCjEBW6qa8ujGYZ/TR6tPiu40eLFdPu/5jFyflD4w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1375 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BN1BFFO11FD013.protection.gbl X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD013;1:noayWaqcTirFcjxq4l7M8CimovGcNz188NtjV5ZnM9xyWh3CUixxEQgxjE+47ieDR0QscGXxyRphMdVwuoJDohL/1K5wTudzc/CV4ygo8ovDTkdsDfmrFHJBN2J5HXqS2vuIabm06oFGxMFuhRkg5V2aScMJr/Q0s1wCPzjpdus+KHkt+c40yj8inHSc93n4clXgOUAMIHztkkPMD2PDdAWSNk1L8iZpw7hKmY2WeH/APKKo8BP9gG999+Oe5hPWY+c3uark29CEbojFf2TZQ5JV2KRWKwl/dZlQWqj7dIJ1RyRVilxxKmUtWie9Shuk X-Forefront-Antispam-Report: CIP:66.35.236.236;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(339900001)(5001960100002)(87936001)(77096005)(2950100001)(46102003)(50226001)(62966003)(85426001)(19580405001)(77156002)(92566002)(86362001)(6806004)(47776003)(19580395003)(86152002)(66066001)(189998001)(122386002)(5003940100001)(76176999)(53416004)(106466001)(40100003)(33646002)(48376002)(5001770100001)(105606002)(16796002)(50466002)(50986999)(229853001)(7099028);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR03MB239;H:sj-itexedge04.altera.priv.altera.com;FPR:;SPF:Fail;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2PR03MB239;2:XawP97/qluGlK6l9ZyMNSvVQid9t7XfImyI0OSBIdRj9lWjKvlq9qAcFl962XInb;3:D6AUUUHT188sEHaItCdzkGHHQEz+19iSr+9RFrRKqG4ohPtms4XqFebfQ4fp7ktNv3nAdqLz6iYmufnLZp1h5+OZzr6ELJPjnzPBIZSZvLmluLLZLJsM1ATBjFzfxAznq7sVNw4VbFaUpRqZrMKmM08ldoh/YYv+9sRtLKxsb9eo0XVz0WgYNC9nLvOM0vhEq3/AOttWeqGiWAeX8AnBdMJAWWkS7Awwi4kcVUv0aNU=;25:p8lrkQiyjP7RK8pYK4rnUuX1/wlfJ9wcCx/yEVPnSJBwISdTWMX97ErtMu4w/CGMc+BR4KB1quGMuBOUiE9jP6YQ4XCe/HyFLPJ7HcBDj1OnfbSXviM+DDOu7o6w43W/zYeOsOuRvru3BUqBMrjKPZfkVba4t71SmXwcn598yhuCJcX3d+u+G/S+O6sJIQNWbZuDV9Mw81tPCamxrS17hRLkAQWHxjjOwl9DaUfQ09AIjjyM9MFplYwojJeAcj+7uIcxGLHQJy+GjUsqxygE0w==;20:+F3J0TM3RErpEKVMi6sga4aiCc4UFOsQ3P3M2yzP/qGD3hKmyeK7z7hA1pO5t6REVdfCJlvreL1FBCXkz1u7A3jsSgD36UaOo9EQtFrxjhLuKj59Ui1WRvbriQPkwaN2eW07p8Ewt+3pw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= X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2015 04:05:24.6642 (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: BY2PR03MB239 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2194 Lines: 70 From: Dinh Nguyen Use of_clk_parent_fill to fill in the parent clock names' array. Signed-off-by: Dinh Nguyen Tested-by Gabriel Fernandez Cc: Peter Griffin --- drivers/clk/st/clk-flexgen.c | 6 ++---- drivers/clk/st/clkgen-mux.c | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c index 657ca14..ed0696c 100644 --- a/drivers/clk/st/clk-flexgen.c +++ b/drivers/clk/st/clk-flexgen.c @@ -243,7 +243,7 @@ static const char ** __init flexgen_get_parents(struct device_node *np, int *num_parents) { const char **parents; - int nparents, i; + int nparents; nparents = of_clk_get_parent_count(np); if (WARN_ON(nparents <= 0)) @@ -253,10 +253,8 @@ static const char ** __init flexgen_get_parents(struct device_node *np, if (!parents) return NULL; - for (i = 0; i < nparents; i++) - parents[i] = of_clk_get_parent_name(np, i); + *num_parents = of_clk_parent_fill(np, parents, nparents); - *num_parents = nparents; return parents; } diff --git a/drivers/clk/st/clkgen-mux.c b/drivers/clk/st/clkgen-mux.c index 4fbe6e0..b83654a 100644 --- a/drivers/clk/st/clkgen-mux.c +++ b/drivers/clk/st/clkgen-mux.c @@ -24,7 +24,7 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np, int *num_parents) { const char **parents; - int nparents, i; + int nparents; nparents = of_clk_get_parent_count(np); if (WARN_ON(nparents <= 0)) @@ -34,10 +34,7 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np, if (!parents) return ERR_PTR(-ENOMEM); - for (i = 0; i < nparents; i++) - parents[i] = of_clk_get_parent_name(np, i); - - *num_parents = nparents; + *num_parents = of_clk_parent_fill(np, parents, nparents); return parents; } -- 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/