Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754381AbbGGEFq (ORCPT ); Tue, 7 Jul 2015 00:05:46 -0400 Received: from mail-bl2on0056.outbound.protection.outlook.com ([65.55.169.56]:19778 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752445AbbGGEFY (ORCPT ); Tue, 7 Jul 2015 00:05:24 -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 , Boris Brezillon Subject: [PATCHv2 1/6] clk: at91: make use of of_clk_parent_fill helper function Date: Mon, 6 Jul 2015 22:59:01 -0500 Message-ID: <1436241546-16731-2-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:fYgrtDXk+fqvAoVNmqNgoUsxzdakb1OvQ3BUzQwwh5h3NSXKZswv9dw3VVh0Hlmt;3:Iv0owDTKFq0IfVEXye9UbXFW2VkCI9BUJA9knN3HBAUX3ffu/bUIvvpl9LDbPcB/gxe1lpHS8i/VODJsLYvrWQvjq9vz3d/JZL4XzuerUPnzgvpvTzrP06Rl+J4eapCsHRVLZRJcFnrpbF11fG5nPQ==;25:Qs2///EvAjk/1RJ4S30WpquVhMXI17nXxeuKp3iXQxVrPd5KZBVdxO7sF262R/XLvOrST5kHvHdSXxZavj+r+dD3l5/UWZgsNn9bKCezAy/7HOtHR2dFZaM5ME778bt5DsPjQppsr2QVZVji78ydxx/K7Vqfic2uwdeaf3wSEd2LVUdzI9FRPMtPdoVFE5rg47zo3s0NFKzShqLNTKU2lBYhJmGz08SLrOC5L0NhXTV5UAI2DBKQ5Pp3IxG/XDbY;20:SvVg5dTr0km9mTFGHg17hFzFXb5ahqhp5vgAPJGrcAld9MVZNWlSWYfhHDre7j1WJ6bPDLIjWGmgTheUEYANIMBqRZzk2s9lWlxv/AbZtCM5PugWiTqjjG6/9Iur5LLnqwpavCsC0EfHbIVEdD1003nd/WIc6xETc7P9poPByYg=;4:1L28qy1FdXvwXVWSya6QLWoCcIWgFVZdHGoutaG77tr2LMAZr/o0LHnIBMB1O1fGK6Y47A5WpGTN6O97bdTAdSY5YhUr77kP13a+eLrJWU3lYsd4iQk1z5vzVn0xHQuYDMuytFgUju4ZpJO/bcLakoDrWxB//YBFECp9t3TWSXMusjSDNPHfnTrgXejN/qjmIi/3LDH6wJPUsGpYAOjUpcg7Woj/UxS3JPK0/kRT2JjtRlf41JGVy3XulroSxNIIvV4fNakrFuorp3YZpLmQLzt8UKwZOB6te281tuliId0= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1375;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB122; 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:BN1PR03MB122;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB122; X-Forefront-PRVS: 0630013541 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(979002)(6009001)(199003)(189002)(19580395003)(92566002)(189998001)(66066001)(77096005)(122386002)(62966003)(40100003)(87976001)(5003940100001)(5001770100001)(50466002)(575784001)(77156002)(42186005)(50226001)(50986999)(5001960100002)(5001920100001)(86152002)(2950100001)(76176999)(19580405001)(46102003)(33646002)(53416004)(229853001)(47776003)(86362001)(48376002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR03MB1375;H:linux-builds1.altera.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;A:0;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: =?us-ascii?Q?1;CY1PR03MB1375;23:b0Vp8b4t6iNHf5c1us5fl6Q2J9/msEJofBze9URw9?= =?us-ascii?Q?05cmRZpXszFWlpcfHKYFrKQ3wlBuc/xl9opKz00liZ4bepK71KJsUBhV1q3+?= =?us-ascii?Q?QUzMx73KJp/CbQTATX6OWg6lrXOl4LlrZsV0YnrFFf+g0Jp8cVDyW3TI2MjM?= =?us-ascii?Q?0HWbW29brUtV8Iaa1NR/aHezDLRVOxb5wZr3p/PUUztknbYwedlYzp2mB3S1?= =?us-ascii?Q?LDV/wvmwXnHVPClWirT+U7CvF27+yeTIMmUuOui0PFvyfcNXM8MRaCwW5EZw?= =?us-ascii?Q?SAohSipmfkoSNon89ij1xVCMUY8oWI/vYhbV51Y938qOjyPXIdUYw4XVPPjJ?= =?us-ascii?Q?Lzw+ItJc5OA0Wa0KIAba6Fwkcmy/LXNuhJoGyjZ1xR0hdo7vY9pEpFfX5QUB?= =?us-ascii?Q?OLNJWXGV9rzIYmJtbPbx/3DCzja/GnYlZbdsBnR1JaxWvuVMDiYBqyUbwWFB?= =?us-ascii?Q?YomCmobgrw/IxEccRRZAKk42KK+SMPP7M8UHEZtYP1up2AzXwSvHAVkYsynE?= =?us-ascii?Q?p1qgwooLlr9yswXo9xFMqH3RIEbyHYhemAb8mNoSu3SUGYIjX5TpB6vdNnC0?= =?us-ascii?Q?cP/EUSbjWDZUv5KIy+P0iuegrcR+BgiEftPVL7sVjmNSRqZ/+di8SKbuOHsp?= =?us-ascii?Q?Ohr+FTQ3KYzp7oR9jtkFpuBsvSTUtQEdfNo8d7QKT2773sz+ExnjTF5t9mXj?= =?us-ascii?Q?TrYvfQyyfogRGls+nMc7rzJWt1VlFWB9Nk/LyEJBEf5ckEhDC/puka/f2V6M?= =?us-ascii?Q?XlTghQAT0V7UxpQLtHZ4kju0Upi9cX4We/8ZO9IzDyxJQGOwDHtiRN8t7qL0?= =?us-ascii?Q?+cYwdWTw0cTnmPz16qtOl4UC4prZqpOzparRoBUOafEVjjjy2hFdpfA45J+L?= =?us-ascii?Q?k3Se8mFFRcvIEFnmkmmlu27fX9ua330cjEO4+GQEOWhrBTL4i/oiazXaK+6t?= =?us-ascii?Q?eqbgRXJ981+B05LnnxvzSqxYmz8U1+059XkEjVeij53MLTBc5T5R1OqtvXRj?= =?us-ascii?Q?aSNaKODN5MPeuXNwtIMoPsu?= X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1375;5:37af/x9lbHtoctnWjX8BWaqoVb6+f3vZ5XJ7BVwWkuEeas24LcOB/j1Vlcw09hqTUbQryfMZPk4ZEqaei/mbxcveWnCCB94YX2HeLAUkOLHAB+DIZxKC2OsuiP9+crn1SCvsNza6vyVB2igVLp3/kw==;24:CwVNd+DUOZf+J7uHyufcu/H891+8hrAm0VjiCSUqSOPBZ39DNsvIodzxMqFaHl1D3pFudIELeTaGL/YO1pYfYvHXYdnSOipDXTNT6KiMGwo=;20:/LBZaXuUODlh7hWDZFTKmWH7aXN9jenmsX3GLX2g9WgZ4wZyrEi1bbo9UbfTqnL1bfkTl1SVNUNi8YqV6mjL+Bpn4ASDZivobWmcWGzyFQskaRjG71EKZN4ugw7AWPqVUgTwJhCtNeB3YIxcjpjilyrA9Uu/mNVined+ObSyuOA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1375 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BN1BFFO11FD013.protection.gbl X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD013;1:56RpvQUmZcWtiEpLDjIwR3kLDcg1x3Ga9CCwukpNL3NA/mBel+fhJv/z8jB8TX8FCtm6gOfS1zuJkUpg9PWeqivHHQ9QRxUp+5kRVigHSL7D9xqwXUVE4vr7jGMk9Y9v16vZVt2k29YzOC/rqehHMqT6G7p4FIX2nrE5/UdHGSrQJBuOVQbMiD1hgaFth8bWf6Q5Bl9dWCmUT9YiZB7QiQXOHQa9j1LLWCi1kssPOK6AxZ5BdWKOGU6ZjulXUAWmVXtxAeLPNjcv1lHI98iPfAUDpe30aehgAGs3ApxLYuVa4+f1DqK23qHGk8yJRlBk X-Forefront-Antispam-Report: CIP:66.35.236.236;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(979002)(6009001)(2980300002)(339900001)(199003)(189002)(76176999)(229853001)(2950100001)(92566002)(5003940100001)(50226001)(50986999)(50466002)(48376002)(87936001)(33646002)(5001920100001)(66066001)(6806004)(19580405001)(86152002)(16796002)(19580395003)(122386002)(46102003)(106466001)(47776003)(85426001)(77156002)(5001770100001)(5001960100002)(40100003)(105606002)(62966003)(77096005)(189998001)(53416004)(86362001)(575784001)(7099028)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1PR03MB122;H:sj-itexedge04.altera.priv.altera.com;FPR:;SPF:Fail;MLV:ovrnspm;PTR:InfoDomainNonexistent;A:0;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB122;2:eMJ0js+TN1XWgwDpmqpddLDpZ3N+Z0pgF8Rjo/wC7f1KWBc8cwyYyPZXwP4Ttw+4;3:AOKAuBYzbEQu8v+Exse3jwFlLsklMvpKNJjF/cFH03b3NdiXxoe6E/0MQRzceGRnafFvTcI6SpQCqGSUI4NJjnY6rr5MqZEpkuVGF0WOBk/kste3piVcSIq8ZUBpTzC+/0mhR3g79/XsqqeushHb17nJ3JS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SNGgbc44gqkCxBwgpr+JI3jrGAZRnhkwkGudpvC+LiE77RYr51T6Ty7?= =?us-ascii?Q?fv7OVZ+HJXJM+wls1hyMbFSkPNeUYBVUfs8ZKImD9Y2Lrh9NWoBJEodrik/E?= =?us-ascii?Q?3lqxA3Dw2faDAbOlcrq/I8ruGdcWQzoJqeyAlmHGhGAN3JlG5qCg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB122;5:Peq8xpE35X7r31eC++mbUqjrNniUa00ykwTpgsCZTkaefIyCpGqVdWypCzyXsCKuo45M1TtUr0i3boiXIbSM2HBZ6fEdM3o9DsyGraR0a3U1Xz4tU/hj5O3iXmWm9mwfHAcwtho7+yt5rirV9GkBZg==;24:m/u6ZB06auWceIj9PqsiV2k0OJ3/HYD8090nIHa0hTzDjzn/qfBwAw/tzJRyDo3o921lcqbZqR0NCmmGGJKvjsvJSXXbifeiLRBI3bdjLXM=;20:9SxMi5coDpJcIuDZ1VTbfqHVj5LKG13M9f+r14vHTlqn5T+jAF3jzG+9P/tUa1yvv2cV4qFg93/JCRv3dI7RWlbCTBGK9z4PzQ0XnDcnmqR719PLm31W1sc+Y7Jwr/c4hKbX7dtoGA0ZGQTeKivL0DFnGfadZMD5rpBKBziEoXU= X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2015 04:05:20.2651 (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: BN1PR03MB122 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6020 Lines: 188 From: Dinh Nguyen Use of_clk_parent_fill to fill in the parent clock names' array. Signed-off-by: Dinh Nguyen Cc: Boris Brezillon --- drivers/clk/at91/clk-main.c | 7 +------ drivers/clk/at91/clk-master.c | 7 +------ drivers/clk/at91/clk-programmable.c | 7 +------ drivers/clk/at91/clk-slow.c | 14 ++------------ drivers/clk/at91/clk-smd.c | 7 +------ drivers/clk/at91/clk-usb.c | 7 +------ 6 files changed, 7 insertions(+), 42 deletions(-) diff --git a/drivers/clk/at91/clk-main.c b/drivers/clk/at91/clk-main.c index c240045..13f481b 100644 --- a/drivers/clk/at91/clk-main.c +++ b/drivers/clk/at91/clk-main.c @@ -612,17 +612,12 @@ void __init of_at91sam9x5_clk_main_setup(struct device_node *np, int num_parents; unsigned int irq; const char *name = np->name; - int i; num_parents = of_clk_get_parent_count(np); if (num_parents <= 0 || num_parents > 2) return; - for (i = 0; i < num_parents; ++i) { - parent_names[i] = of_clk_get_parent_name(np, i); - if (!parent_names[i]) - return; - } + of_clk_parent_fill(np, parent_names, num_parents); of_property_read_string(np, "clock-output-names", &name); diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c index f98eafe..38f646d 100644 --- a/drivers/clk/at91/clk-master.c +++ b/drivers/clk/at91/clk-master.c @@ -218,7 +218,6 @@ of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc, { struct clk *clk; int num_parents; - int i; unsigned int irq; const char *parent_names[MASTER_SOURCE_MAX]; const char *name = np->name; @@ -228,11 +227,7 @@ of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc, if (num_parents <= 0 || num_parents > MASTER_SOURCE_MAX) return; - for (i = 0; i < num_parents; ++i) { - parent_names[i] = of_clk_get_parent_name(np, i); - if (!parent_names[i]) - return; - } + of_clk_parent_fill(np, parent_names, num_parents); of_property_read_string(np, "clock-output-names", &name); diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c index 8c86c0f..21492ac 100644 --- a/drivers/clk/at91/clk-programmable.c +++ b/drivers/clk/at91/clk-programmable.c @@ -230,7 +230,6 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, { int num; u32 id; - int i; struct clk *clk; int num_parents; const char *parent_names[PROG_SOURCE_MAX]; @@ -241,11 +240,7 @@ of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, if (num_parents <= 0 || num_parents > PROG_SOURCE_MAX) return; - for (i = 0; i < num_parents; ++i) { - parent_names[i] = of_clk_get_parent_name(np, i); - if (!parent_names[i]) - return; - } + of_clk_parent_fill(np, parent_names, num_parents); num = of_get_child_count(np); if (!num || num > (PROG_ID_MAX + 1)) diff --git a/drivers/clk/at91/clk-slow.c b/drivers/clk/at91/clk-slow.c index 98a84a8..84c19d7 100644 --- a/drivers/clk/at91/clk-slow.c +++ b/drivers/clk/at91/clk-slow.c @@ -371,17 +371,12 @@ void __init of_at91sam9x5_clk_slow_setup(struct device_node *np, const char *parent_names[2]; int num_parents; const char *name = np->name; - int i; num_parents = of_clk_get_parent_count(np); if (num_parents <= 0 || num_parents > 2) return; - for (i = 0; i < num_parents; ++i) { - parent_names[i] = of_clk_get_parent_name(np, i); - if (!parent_names[i]) - return; - } + of_clk_parent_fill(np, parent_names, num_parents); of_property_read_string(np, "clock-output-names", &name); @@ -449,17 +444,12 @@ void __init of_at91sam9260_clk_slow_setup(struct device_node *np, const char *parent_names[2]; int num_parents; const char *name = np->name; - int i; num_parents = of_clk_get_parent_count(np); if (num_parents != 2) return; - for (i = 0; i < num_parents; ++i) { - parent_names[i] = of_clk_get_parent_name(np, i); - if (!parent_names[i]) - return; - } + of_clk_parent_fill(np, parent_names, num_parents); of_property_read_string(np, "clock-output-names", &name); diff --git a/drivers/clk/at91/clk-smd.c b/drivers/clk/at91/clk-smd.c index 3817ea8..a7f8501 100644 --- a/drivers/clk/at91/clk-smd.c +++ b/drivers/clk/at91/clk-smd.c @@ -145,7 +145,6 @@ void __init of_at91sam9x5_clk_smd_setup(struct device_node *np, struct at91_pmc *pmc) { struct clk *clk; - int i; int num_parents; const char *parent_names[SMD_SOURCE_MAX]; const char *name = np->name; @@ -154,11 +153,7 @@ void __init of_at91sam9x5_clk_smd_setup(struct device_node *np, if (num_parents <= 0 || num_parents > SMD_SOURCE_MAX) return; - for (i = 0; i < num_parents; i++) { - parent_names[i] = of_clk_get_parent_name(np, i); - if (!parent_names[i]) - return; - } + of_clk_parent_fill(np, parent_names, num_parents); of_property_read_string(np, "clock-output-names", &name); diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c index b0cbd2b..b3cbf45 100644 --- a/drivers/clk/at91/clk-usb.c +++ b/drivers/clk/at91/clk-usb.c @@ -373,7 +373,6 @@ void __init of_at91sam9x5_clk_usb_setup(struct device_node *np, struct at91_pmc *pmc) { struct clk *clk; - int i; int num_parents; const char *parent_names[USB_SOURCE_MAX]; const char *name = np->name; @@ -382,11 +381,7 @@ void __init of_at91sam9x5_clk_usb_setup(struct device_node *np, if (num_parents <= 0 || num_parents > USB_SOURCE_MAX) return; - for (i = 0; i < num_parents; i++) { - parent_names[i] = of_clk_get_parent_name(np, i); - if (!parent_names[i]) - return; - } + of_clk_parent_fill(np, parent_names, num_parents); of_property_read_string(np, "clock-output-names", &name); -- 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/