Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932756AbbFEQcr (ORCPT ); Fri, 5 Jun 2015 12:32:47 -0400 Received: from mail-bn1bon0080.outbound.protection.outlook.com ([157.56.111.80]:54848 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754791AbbFEQco (ORCPT ); Fri, 5 Jun 2015 12:32:44 -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 Subject: [PATCHv3 0/2] clk: of: add helper function to fill parent clock array Date: Fri, 5 Jun 2015 11:26:12 -0500 Message-ID: <1433521574-31052-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: CY1PR22CA0016.namprd22.prod.outlook.com (25.162.32.154) To BN3PR03MB1367.namprd03.prod.outlook.com (25.163.34.153) X-Microsoft-Exchange-Diagnostics-untrusted: 1;BN3PR03MB1367;2:5Pgc7syCPJDrjWMf2nW4nVz336QQDDHZkFjZ2Ll4ySWnSo7PIsHixC4RQ9jJHlji;2:oiUcU6kULk7gKF1RNdTfIWkfeNZxxrkvKG8by2hccPjGHo2rGOf5v4ztUzGp26uend0fydMJ2kbF0wiw1HK7AnV2rJbFR4uzQmIO3RygbLfWg6MecVt1m1kD7UTev/d24hRpY5GtY8xM5KHMV0qkPw==;6:gYsoRtQyvg29VmyfS05QxZnpo+JrjLXyDWQPWqLcOhN1DmmTxRyrgI0SxTpyG5wSWt6lWGiSj9/2HHWlxpkJTyo3t+S++QF4PCGSzPG8JdZtkIKBFp8fpUf3X/8L+61Ewo0XvRbgS43dqV2CaMuNCg==;3:UG7gZgelBOqNK5ud+8Gk922hWDmYnQ/igFDkzmySeQdGKCrGJ0UZ6NIELlWowP8w5kMtvw+Ng6mK1zSdZrhcCFnXEZUHkrMheANH2SuxniEe3ooxU3LS9EzFIca/FDoS/1KJIs9siAaazTr7dEt9SmPBInyCWjM1nD16PUPRDLaU0QqBrQREOcXT6kK/7KEYRwC+ybozNIl3NTGdhG1n+PymuGCpar7DujKlsLGAnRI1/alktJ45Rdf4TK7FIipKKX9DFzkCn6vm0bIEg3Nhyakb2/HJM3zkZYHw85Pxqv7xybogrYnYUQVeTeLinXxo X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1367;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1429;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB233; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:;UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:BN3PR03MB1367;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1367;BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:BN1PR03MB233;BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB233; X-Forefront-PRVS: 05986C03E0 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(6009001)(164054003)(86152002)(229853001)(46102003)(92566002)(48376002)(47776003)(66066001)(40100003)(122386002)(33646002)(77096005)(87976001)(86362001)(107886002)(5001960100002)(53416004)(189998001)(50226001)(5001770100001)(62966003)(50466002)(42186005)(19580405001)(19580395003)(50986999)(77156002)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR03MB1367;H:linux-builds1.altera.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: 1;BN3PR03MB1367;9:VizMFJKO4MMFW3EgXFJveSS44rbFe5lVJzlnDYZ2B032YNPPYCE0ds3Bkjb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l3wYjNq1GpMdbdZfOOB24OjDw2z166S5oBDvN+JDJj0TJugv4XRpy+b0zMs55aIByRbQo2Hy1kooZtv1QEZn4zgdLtT3lzx1cA7380xWe85ksF5VlQ23wtXVEsGNmibtUK1uETnl9/lRHSXmzKfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1367 X-Microsoft-Exchange-Diagnostics-untrusted: 1;BN3PR03MB1429;2:HkRQbPL+7qnpzs8SjHs2SeyDGnpuZRmtmDbOH2k5u7wLBGfep/8W6wlYsEGCF9vD;2:HYkl/PoTrWnijbyWCGs4RkCaWdjhPHnQWOMR13cV4djqbOr8p7Lw3WuJ9XvQmBYdqcfbrYPfNkLG5XukwA91HgvX8CVUOF01+Igx0UND1rNWBk7HQ3tJHzSbgymHYlBoxUlIlP+Y440jarCKWOLmmA==;9:SP2+2RJ3LaH1Ywtc1MUl/nL8Wg3w1QNELNdvjpEMI0FgsZiIexWqf36bgHfotF8R/bev2fcikAIVPBAgWoZYmueAWKcydz/lYDJfM+pBEgCPKNGic3e0myZUmGC4o4Tf4Detstip0Be1lIiRLIugug== X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BY2FFO11FD018.protection.gbl X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD018;1:M1jWUb3maTWo2lR9iRNSV0xjXCOURjPFf8GIr1DLFZq+h+82GAQifV1HEEh9Wau67xxFCKhU8KzggJsYselENcbWiEV6+ZBZv9Ub3rIQeFrn6tJsjBPFHYGyWRFPgrE4yf3a5s+yovC1xFjrtM74VVQib/pDIWiAUj/xzWuH/w7JzJjvY6no/+lCvpbBQh7mEiWcKI4QT6RtNLZ+Jcd56+3Pqjjk20t3x4KkuNHB/A95veK2Op/lDrrkMDRv8oGhWWp2b6TrSA2imi0iTGzF9GdHXigaFVkxum+o//Jt2ZSwwLBByXHnGTZ3uu8EefSPTVIs/jTNpGg661gJWkMadw== X-Forefront-Antispam-Report: CIP:66.35.236.236;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(164054003)(189002)(199003)(189998001)(5001960100002)(107886002)(50466002)(5001770100001)(19580405001)(6806004)(50986999)(48376002)(46102003)(106466001)(122386002)(229853001)(66066001)(33646002)(53416004)(62966003)(77156002)(40100003)(86362001)(47776003)(77096005)(85426001)(50226001)(105606002)(87936001)(92566002)(86152002)(19580395003)(7099028)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1PR03MB233;H:sj-itexedge04.altera.priv.altera.com;FPR:;SPF:Fail;MLV:ovrnspm;MX:1;A:0;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB233;2:bSgYKc0j7CLnq6xY7/d1TSph/yAKKTiB+ZSU+9na7gY56v3F8dlDOmCjRA8FZ9ns;2:6FZxXLj5cey6tpEPAL4vHnGH6aNpKSHjpU3cVcasrWUulfb0Qfh3U/X1igg1ro3Fq9OkRBhs26U2sqkFnketvABhFG++fh+UGYhncx/51/qVCNidTT88e9tg9YpfQcazFW81H0QVWwmIfDhw32MhegKX4iIaLiV6AQy5oGNxP8gteChKkcvHtwFvjEvPYij3T8oug21dHoZJ+0hjftA58HS46dkwnBctwMeCCNnsY4U=;6:OT4ZuW8h4OViCOibg4bovX0uWpugYcBkuK4EoLS4fbTlDFIrxE194534lMz/c9A7dcbodwSkyOP8Gbayc33ckJQCyPXW6jbENsy333S4wKuyD6+NobhGG+jq55E9IjhjCfl8GEVkcSZG4f4wDY3wcg==;3:QcsV9Ec19AE2jvb+YSM8sD2TMsnxIwAcUwHoeRMoP6oaPuIqQOLHyPY3ZRrw4+IQ4eGGdUxqe2/+ZO7Nk6HYkQ5bV5bwp4RF/KMroTrBeDLAtU5tTcYvBtCRNtamlZoRagsFypEH+WKWawbzXWKXqaHLWdysr4YSaDRsWijER5Ihe4eE8n4nNlNGXlb6t25H+foHdrKs0beevnYkBCsvUP2jKcuUPql//4IffG+e0C3HWsv3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sKFs55+IoJlAb4XnYMc9mTj X-Microsoft-Exchange-Diagnostics: 1;BN1PR03MB233;3:WyWGAVV369IAxI5+q/EzkP1hrhw4ZRiykXMwKuvr3Ktb7REzLbc5tuRD/N+8p6jO+JxbC/6jYiYJ0aTPMfd/MQOpFRHM9Mrg6f7jt4zA+Be39sYR9o4+1OZFEk+LKwf/mt0aHP2UAb9wHFrHT2/EEQ==;10:gT94MgtegGx5V9QnepOdAhTjTrtK/qBI8g+QDgBXriTkl+5N+DV5CopYvvGAEcZy4vOaIdaT2hJ5lgbXFA0gNSxD+6+vyfH7LpA42fdhtu4=;6:OjscOHaGlSABug7SA+NkN1wA/hiCYDfN5v8ffgkpXHsAw07kcFbkJlDt/RCr1B+Vf2/b1/HYJmYUhofV6aAOQwJ15D5eSNolI50fiBEOthySJXJ087ze42ukOCRMqB1APCk0WyY0EJHVjBoNakzpPQ== X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2015 16:32:40.8651 (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: BN1PR03MB233 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1462 Lines: 44 From: Dinh Nguyen Hi, As suggested by Stephen Boyd, this patch adds a helper function that will fill the parent clock array. Since the following 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. v3: shorten and clean up function comment, use EXPORT_SYMBOL_GPL v2: use unsigned int for size 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/