Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932178AbbFAVw3 (ORCPT ); Mon, 1 Jun 2015 17:52:29 -0400 Received: from mail-bn1bon0062.outbound.protection.outlook.com ([157.56.111.62]:22404 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751889AbbFAVwU (ORCPT ); Mon, 1 Jun 2015 17:52:20 -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 0/2] clk: of: add helper function to fill parent clock array Date: Mon, 1 Jun 2015 16:46:24 -0500 Message-ID: <1433195186-14867-1-git-send-email-dinguyen@opensource.altera.com> X-Mailer: git-send-email 2.2.1 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:RtEadhJ3C2eXsDq21oEDsg7s2oo0geY395xwC1Z76LDQydu9O/9pwVyQ+mK+arkq;2:KhDHDnwOTPyAtUOyK6BvQH/GdtthkiyDeAgpl0bGh4O01F5votVgvKO0jd9bvbmUxJoXq4YOLWIH+aGFY9BVcpdU3lI+XQ1/lsNXC//MVMRMRHfC4gjWVSWedBv4uURcBFovId9c93Mk3ByJzstswA==;6:a2B82n8JrXOKPaa43Kg6sx3oOgCcudBArR4Cjp57jCQ9DxpddmgksIJa4pZKfChBQC7sKwC8ixY8hBLGrE03z0Nk738ks7rsQ+Y5Gq1VBbeJMhDFUiW8DzsZToVneI+aN/b+sU9Bu7SLj8yBFMtQIg==;3:SuslcrpjBJg2a66ZGc7ns+RPBPBSPh+qQS7rODK4PP7nxk6iX2CW+j22yeuXLjW7Maw3vtmT5etm9qIDGC4rypi9xKf5xfPF0V8Fg9/KkG+7Qv3zSrNtRC8rMFhg6I2BOsr/WPe8CGGhaREJ0i4saw4yL3cLWJD3250QpUb1OlYK4GEwuahgCU8Iz+RNIQ41qZbT6oifstZfmIMUPvG+BXFj9fq+tQqz88vd5QVGTkbXhOtQioNSevXSKvxoBjElyrrGDHEYCB3CzmCIwFIiXFB/esukVuw3far63yzzz2N3sTSE+jmLUP7ObYel6F4K X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1373;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB231; 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:BLUPR03MB231;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB231; X-Forefront-PRVS: 05947791E4 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(6009001)(189002)(199003)(164054003)(86152002)(19580405001)(105586002)(106356001)(86362001)(68736005)(47776003)(92566002)(48376002)(77096005)(64706001)(62966003)(5001830100001)(5001860100001)(107886002)(50226001)(5001960100002)(77156002)(189998001)(53416004)(46102003)(97736004)(50466002)(50986999)(5001770100001)(122386002)(81156007)(40100003)(229853001)(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;C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JIxNEMTO48J?= =?us-ascii?Q?H+kZ8Dr81kCOdWJJ2A0UvriTFGu/NzQpfDczVOfrSbwMYeROUbociYAd9FqS?= =?us-ascii?Q?1+YPkxRZmg+9OCu9WMtaNeQ81N8zjyl4fN5QaH4aj1vKU8ae1gNavhWpkR04?= =?us-ascii?Q?Wxghk2WJorG1o5bI1wiiSgnIgnpm1xCy7wGDXU2kVD1udn4uc/KeekaQR2d5?= =?us-ascii?Q?PqkGpHQ/yzMDgQ9OkZ0ttrDeZCtazlcVWWLB9yMp20oyWwAl1a5OTCkhU/AB?= =?us-ascii?Q?H2InLMF+Y=3D?= X-Microsoft-Exchange-Diagnostics-untrusted: 1;CY1PR03MB1373;3:cdtif12Ao8ctuGza4JFxX+WpKckRAvBv+p0YeMd53LY1yKkMB627+OwjPdnP2nGrkXhUKnmPB8TiJJnRUc49hBMLA+o2pbZxp1++6Ehxh6NtNUDTWs7Si7QpacFfjeziUMLsOvqJFbnJ3MpA8t0Bfg==;10:KbNwn14P03oTvxQmqcoTyxo+iJNktNOB7JDQBlD1VO0ec6wexqSY4a1bv7Zdd7VvH3pbdviTYvjxyTv0vKMfrGbOiU59zBTQbgrmDXyGDQs=;6:D0Z/olZv9M8W8niyy3PLOp/yvT8U/qy3ctGHg/m96MVQdVyP+DixcSmZAlLFjUqKruu22N0hgi92qgwqop54MgHaCT5NPdtgm3BC2HxH28rtH5+13lt4TAtCcTApz9UiHyamPcos+K3kyoZBS1HWFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1373 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BY2FFO11FD013.protection.gbl X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD013;1:T2gFHQw8+n46jxr8qsdOc/hAN66Z3oiqYDONOtjEsTFYquSiHmXaE5fp5y1z5/XSUSefbRk8ZuvBn/PcBWyeYeeuE0YPnKpj6j6m3uyQLyIQWGr93K/UHG6CLM03VHAgEl73eMVKeOAtkezmwlZZbHuGBdRFVXTm/JdzyXhkGQnWFmPJ/pC7a5mVoahYIu28y9EK0/v3FaSpQ9w5lUttfFM/0fXNENKgRLN71B5NTl10SNA0x7nY9WVMoJQGatu7LzHqSu8VqRYr6wQR4r24wA== X-Forefront-Antispam-Report: CIP:66.35.236.236;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(189002)(164054003)(199003)(50466002)(33646002)(86362001)(53416004)(16796002)(50986999)(64706001)(47776003)(46102003)(229853001)(66066001)(48376002)(189998001)(86152002)(81156007)(6806004)(19580395003)(87936001)(85426001)(50226001)(19580405001)(97736004)(77096005)(106466001)(68736005)(77156002)(6070500001)(122386002)(40100003)(92566002)(4001540100001)(5001920100001)(62966003)(107886002)(105606002)(5001770100001)(5001830100001)(5001960100002)(5001860100001)(7099028)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR03MB231;H:sj-itexedge04.altera.priv.altera.com;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:0;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB231;2:n8sNoqKS8vXITMp5EIG3f76rXOL6ETI5+23iITcyUe4AgG8PsM3jES6FamFCFhJP;2:4iGAyHlrNbnSkyjU2MrV8a1Q5Rs63bHNprtwBeRHkgf7KYRCZuSwddmcKZPg9gDfcFFGxbiae6QmMsegi1fAs+GUOEJ1fJY3pxVq4bw5wRTWvcg/RDBe5ggZryjaP63KenXaKtybrMcOvagQhe1c/55k9k8WiR1DV8RjOS0YLe4psOone98iEY5EpxsI8wpPIuTa2jjodthZ1rYpZlvh7qv+3aLGexUe1DQ7F4AMsrM=;6:bjWWjBr1UPykyuj1+vmnFI6DbwIbx6IXMLw0XgUdSg7dQHLStEawqw0w5A8zT5K427UyEfEVXV4JeB1uPPjAp+Ek2EjNtm/YnYjlDxIdhCKYUwsgS+gsTAS/4E0rFHbBb/psJu3rpWQ1KD7TjlK0hw==;3:vjfBcg3DafSdFYJqWCUsil5hBI6Gc4x5OUXsGxaRk59OiwuP0tWU1GXLDGfQyuBo33ivpkC+Ry9yDTDccS+UeilCDPX2uZrsnqev+hexL82E7h12VXOrxYYP1dPoC6AcdJrQwuq8svVzjnVUwa5itWxrEH9Hp12Qf0SAgIHm8z3l6s4FwpFDU+pDOmH4N7QFD5IXkGeu+HRF84SdiuPXUUO+kyd16K877auNsbu665P+qo+VPOvomGS3qEZvLJuSH3Q5YUeeKlySSVWuClgrRqyzEzKmxbhgDlZ0Z8YE+QfEwpMYemNS3IG6h3YCB+qt X-Forefront-PRVS: 05947791E4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR03MB231;9:ERL5F7bNQtFR+jiycC8kc7lNscJJh96paM+JRQB7GMk?= =?us-ascii?Q?ThKZWlQwb5djXnuqDneVeYFjKmjrrdDW+i51oJMYVwnPAOpx096rC60K3cul?= =?us-ascii?Q?8DEUomacIU40JBqtRjy8beJ+3gYF0XCpHNM/j3ohd++gsTLFOQtY+Adb2nrX?= =?us-ascii?Q?n9ref5gvVD0jWuVL2lYloT+cGhBP9g3PpG7fqy/smsq3ERVJVdbZMnNsbJUx?= =?us-ascii?Q?tLmRGeQOL+JBWWENkRXmPGvz7vAWwWIr6uxTgizJTeKeR9o8td1CmVxZXiFT?= =?us-ascii?Q?9yB6szHN7eCFTdxUleh/GAo1jAsr6Bpaod1YNcgBVL63R5AAlxi+tiEXLWyn?= =?us-ascii?Q?euKSxTSoF1/3jV3AFOHI0kxDvFFZ10JyHpkjSuDHjJxG/Eh9zsztzmc38A1X?= =?us-ascii?Q?1lTOMBfn6oYH+ouROc0yWBTk33QEWNLW6z5KIYOg6ifKg0/fh5d4atFDXLXd?= =?us-ascii?Q?3Ev/YcOvCXIh72xuIEa7eIrRsq+pFFO9ojrQMtugBzrGjEf9LeMdKEYpQgRN?= =?us-ascii?Q?rLrIyZjXUmzjxo/dgnR18Yi7KD2ivCZcp0cIHc5KUIBJcNH9shvL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Pmf+DQD7RCYSVMnVc1feaNUMALb8ZWso1tawkdHWZQ03hYLmDwOGz6pNnwQhl10=;6:kRrHBZjGkqdtEa2zZ9cFG549u70XA3t5yXXEwyAvyOZDDCDDfP5pxENvbRzZKLf39uxQERK/hJmlbxQ24nPidjXxjlt+HfWoos5P3xLOm/d3sLbT7vpNqj4+jOiqakEAz1WPxSly8zNq+tpxyNK7PA== X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2015 21:52:17.3751 (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: BLUPR03MB231 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1358 Lines: 41 From: Dinh Nguyen Hi, As suggested by Stephen Boyd, this patch adds a helper function that will fill the parent clock array. Since this kind of code is sprinkled all over the platform clock drivers: for (i = 0; i < num_parents; ++i) parent_names[i] = of_clk_get_parent_name(np, i); The above code can be replace by of_clk_parent_fill(). And since the logic of the of_clk_parent_fill is to walk the clock node to find the parent, it is easy to just return the number of parents as well. The second patch makes use of the new helper function in the SoCFPGA platform. If this patch is accepted, I can go through and replace the other platforms after that. Thanks, Dinh Nguyen (2): clk: of: helper for filling parent clock array and return num of parents clk: socfpga: make use of of_clk_parent_fill helper function drivers/clk/clk.c | 20 ++++++++++++++++++++ drivers/clk/socfpga/clk-gate.c | 6 +----- drivers/clk/socfpga/clk-pll.c | 7 +------ include/linux/clk-provider.h | 1 + 4 files changed, 23 insertions(+), 11 deletions(-) -- 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/