Message ID | 1535690756-22234-2-git-send-email-aisheng.dong@nxp.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CDAD81709 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 31 Aug 2018 04:50:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB7DC2BFF8 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 31 Aug 2018 04:50:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF1232BFFD; Fri, 31 Aug 2018 04:50:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 948E52BFF8 for <patchwork-linux-arm@patchwork.kernel.org>; Fri, 31 Aug 2018 04:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S243YdhvOp96/1FFTRacZJPf9Ha3G3ak2GZTg1H7dgo=; b=eqc9OC2FZlaKKt GAPSxLFfg3iqAUEX8PesSZE/BybEG6K+knDTNHysAStihfE3PgWq8FOCX/0g++3JdNGawa2lxt/mL WkJ3i5s6lhkTWkUGCdERqKrgm8R6mpS3JCQ3VPjLFkxQQPKNpa4+cJxzDYP1VvO21nbRIn+hd7FO1 YgNtRMGJuXxJ+o6RfGsPm/0Isv6pHJJK77o5zvhCaze75N9ONg1zZ/raRjiN2ce+AsAVSt6DjMuxX FdHG4uy2nPwNhdWbYdq/rLtwzkroGBqnQGePn1nRlHtnIuSv2X2ZSaSvDUyCYc6glov+Lg5T6xwzX Gl1NymImyPFBKVmbQmHA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvbOE-0007iT-6n; Fri, 31 Aug 2018 04:50:34 +0000 Received: from mail-ve1eur02on062e.outbound.protection.outlook.com ([2a01:111:f400:fe06::62e] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvbNU-0006Cf-7C for linux-arm-kernel@lists.infradead.org; Fri, 31 Aug 2018 04:49:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/8lMrKi/+vt2xJ54YJ0QBIBy7vs8gaLUNa0N+REDGwI=; b=u+6NEH7Zr5SRGWO/XaG+8Pc/E0QQ63AsQolWsP2YzPoYSL+LCAzdkEhmaPXjlshRkL1QVZBPxqR5nyjq9pQcxBTpXTlxhNGoM8zX0k2jR/5hz9kS15pfsn40Ypm5C9b2D/hASz8MkbkHBsy5nHVt8B5pcYjIJ8RnGOiic1qztkQ= Received: from b29396-OptiPlex-7040.ap.freescale.net (119.31.174.66) by AM0PR04MB4212.eurprd04.prod.outlook.com (2603:10a6:208:66::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.18; Fri, 31 Aug 2018 04:49:29 +0000 From: Dong Aisheng <aisheng.dong@nxp.com> To: linux-clk@vger.kernel.org Subject: [PATCH V6 1/4] clk: bulk: add of_clk_bulk_get() Date: Fri, 31 Aug 2018 12:45:53 +0800 Message-Id: <1535690756-22234-2-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535690756-22234-1-git-send-email-aisheng.dong@nxp.com> References: <1535690756-22234-1-git-send-email-aisheng.dong@nxp.com> MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR03CA0061.apcprd03.prod.outlook.com (2603:1096:203:52::25) To AM0PR04MB4212.eurprd04.prod.outlook.com (2603:10a6:208:66::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 210ac8fc-ed9a-4f06-50b4-08d60efd2537 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4212; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4212; 3:34JX+g54hAowwSSp6B2gWkZZdvsCiFTl++od2/nFqjZCAz9T/5F+xxA62vQ+u7DNciSWi9ILdAz1K3kLo+VqESxUJvBmGhaysTg9uR49pNIpSoi+ks+vqbhcbPvHMIyFLwNJruuO8GRAFYLTVkkKfhAUHrkYOulomB7e3IoVf3mADz3XNWC1QIz0yhyERr3PCp2OvSxAqleQ6DF8a2vHEfg/A41PjkZR26+Y0WXjycMW5mljMTb96X7Zk+dj04DB; 25:So3a9E4g+fE5hGZx027Pq9TAFPJtBR21tK1iVWRgb2gfOnwWoSZQtXtQodJUYQax/HLZCnletYgVqvdwd5SmiLPDC1GEzXV6HNDNayM30i1QuAk1R6GYx9JiWiYVYs5jDmLbzZDFwKPYBkkuVPMZ0kL9P7XpIc44Djvzdu2MfCun6iiFbU8fKLI12ND6KA2epcpn6ht03cGwQqpjM5npsbhK2QvlhNzU2bTqgwseYPhtGpuL7djAk0BaSYnhK68fTQiSFGpkdQMAmLG4czobQUmCE6wI2W3hRP3Z1Hz/IUHJvU7iX2xzfsXVLYL8lLCiclV0/+gBSRzxm1whc7lpCQ==; 31:jH8vk+VzlOJNep4/g2zRXhnZnQ25cnfASYVu1ftVdLZabdyaVkgJ0wUoWwDccqva1Lk6GpoWp2IihZ5IE4SHwRDxXgxpDperk2iHTMYWQIDJLTJF7Y3eOJU3q8RB725mQVv4UyVgKfpgvKtSiWOolcEWN1liUfy5vrQBTxC4K4jm/N0r9brKhu7G9t1ImyIwkDIl2kSmS26niWkrQBL1H0b2wn3tKjwHWqg+8JgMl34= X-MS-TrafficTypeDiagnostic: AM0PR04MB4212: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4212; 20:mJFtbdPYRNEmDxvoxW8sIfsPncOLecA1YYsQ44jKNFrExpGIEPdp8U+X5iX4t0V60j/HZC61kmRrRy/x//dg+31nYx4lnBey9niWNx2+HxitOy+myWbZRfqfsZi0f9lYTYj/1xMBJ8vyugjGhg6yiAhXyXqEBKzrCWjS0FTC/yPJ0D9+WGGWdQZ2JbddkMKDmUUhzG/1tAfOu79HIXNDmkbmI90kEuGKPAWiI2b/QcdiiE+szq1d8DZC6ah6gk9BBrBdj99nFiwoXHKssQr7WcBPCcU2r73c6+3F2XBKcmmZ4zrydj5d3PGpiA50jVWC80STY+RxOvhZjMkHuY4uD90qIQB/6y+1r6Y7FAzD7mO/CYAdc402xS2zUMnGo2Dx6tzrX+/YerO8vku0xtKWpyBqmhk0IGBnaAod0xEQs8gS+BfBl7aCypHzVIPIOHag36Cqe7nYlZxVWWowwGzPaYvkWNxNmhHmof6VPit9iYcdZRgUO3SkqsxSWC9teqCx; 4:PmW4f9pJwhOlQ0Ui2vD09qEjNURhm/2QlXY6S1KXX/wHq/HKy8tkCixFe4WBQDyXIsi4qlkNxcO/ZelV/5Oqetwxd4eLqO52HDIOFm3AaOxWvfJIBJrphOny+BiExzcka5Ow4t3pGtFMlEg5iz9qfMazvr5xRKBtNZgdeKYIK6WrBi2afivy4l98Gp2YOcI8p9sRvaFHMsjelgDF8rMqbJ5+Y7oFngPZdRuo1s2w2TkqkYWctqh+rl653Roqs9h0jCmwH3lzC+BFFABsxoUXC3tMmdrq/C8RG3/Ml5PjmSSN+KKnv9C0BKbGwn9Hxf63kKytSwU5OBXtdK8QtG7CD35QmLGZxg8a+/kNW6+fa6I= X-Microsoft-Antispam-PRVS: <AM0PR04MB4212DF6754827958E630B375800F0@AM0PR04MB4212.eurprd04.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:AM0PR04MB4212; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4212; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(366004)(39860400002)(136003)(376002)(199004)(189003)(5660300001)(26005)(52116002)(186003)(47776003)(16526019)(2351001)(2906002)(6666003)(386003)(6506007)(51416003)(76176011)(446003)(11346002)(53936002)(2616005)(105586002)(486006)(25786009)(4326008)(6512007)(476003)(956004)(36756003)(66066001)(478600001)(86362001)(6486002)(106356001)(316002)(16586007)(6116002)(3846002)(50466002)(54906003)(2361001)(81156014)(48376002)(7736002)(97736004)(305945005)(50226002)(7416002)(81166006)(6916009)(8936002)(68736007)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4212; H:b29396-OptiPlex-7040.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4212; 23:/0d+WHTBrNMP607HtM+xhJIcQnyPeARm32JCpF9OU?= VEjDlCa7pcSGPfcTqC/VS4Dz2+6Ps29oxLXWl4mCDu9GzoigtGhgz0v0f+DNmPNo7iOClCyXsykEL50D6gj91l/mZSEpEsk0wMl6Ifel7lqY8WCTXFMLaIUDkGQKgteFlilJiMTgoctmtK5WWQofRqNRzlqiPH3J5OXbdqF35KTQ0bcGDgaQBQCQgCUYyZTH2jjIzdy9eUJDqntTBO0KhMvauattKbl4L5LoFepChhee2UxBXy6O6R1MalbUBVE0udZyG9OoAb3LrV8Ml43Smd/K5KNP5/uoWWIVmCrD3hQBoMo0l21chdFFPHcWk6nLnmZwITrqDBoVnO1Gq578to9nP33LcOoJSIBgrFJ+3RYHt8Xgt1/s2ByQMeWF4ntJXKvxtA7HDCnDKX6TvNGMGzZFU56PEfipEFNzH5J7CiwN2R4xaQR/eCoWCdNA3/Z3+1Lohv8sX02y0k4r05tbY186K/p9g5DmheCc3ZCedufX9BKuPDvJqJpLOegtOZwiDzDHPPYgU2FobJdpY45OP26U/HSmZUGaw3CJVCxUb1s2tnfi8qRZ9S824ThrAmu9lHEYMJky98hxDRvoK+hlAsltkLkVTFK8tV4YNCCg0IY/HxpUKBAu9PYV8OVq6IzzaHWYNvtEM38Dz7NZ4cQrbW4RybGwYHQRz26rsZakX+2QdmuQwpM7LSAbST35Cllm9Dx1wY4UJrBrF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mdNmOm7N0f/9I6vqqii8/iQAe1fp9O0l3ReXsDAIQu2D75tsaC1qRo89VX5S9NXt6oVNr3ydxkadXMpzSOWRLrEhpDncKDmG/R4IeScvumsPMW4+O34TiMO3pcKB72rBW41mjmKTV3Jp+lnooG0+ugnyPBhS+7fH52J9XXnNDxJYnd0wJj7FpngXVYE/Hg6OC2F0pd3gWcvoBD8dnCZ8u8zRxQlQ+y85U+NHpTfjVmIV3/VDdefW+aKMPEtoYiXMvsL5zXQ0II+aNXo7ENgLnVRzNoiNiZqHjwdGG3YNF8mEPP4NbiP+ykcbpIc5MYPjN9MeOU8G5Lww==; 5:1BYVyL4qZVFYusThAeeOBv2xMLiMMGBFcEMmpxtcKMpitkWW1z0oV1PIbQd93rvo9aklAjYamiime2p+Ddvh45zEyLs3nm4VRyuK02FDsPKJOAS4F3uU7ODjwMUj7gnHsWpepJeMXiUAgRCCRxv+E00BjnQo3k+t7bn36oDA2T0=; 7:NBVy4ErDi2DP5mIJaMxqO45RdFtDZMADF4zSDOMazaFqHBn61q0LIq8XpQ7jlHpgfcILf3MiXHI7C95yt/v5+80k49imt9saGRCsFmoOHq8bghAXu4ucSPwPCukc/7fWYwaNG5/yvVNdgJJ+5qVXtm2vHXtt72m3Pl/Vk5BCMd08jTq+Km8lIEJ+TD7LUArYC++kxpOkXPatWLf8XNFn7mhNLyRnCfxO+rVhUbZMH0CrMswcCWNGu3erxtzatgsl SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 04:49:29.7150 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 210ac8fc-ed9a-4f06-50b4-08d60efd2537 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4212 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180830_214948_261145_13B03FDD X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Dong Aisheng <aisheng.dong@nxp.com>, thor.thayer@linux.intel.com, Russell King <linux@arm.linux.org.uk>, sboyd@kernel.org, mturquette@baylibre.com, Stephen Boyd <sboyd@codeaurora.org>, linux-kernel@vger.kernel.org, hdegoede@redhat.com, linux-imx@nxp.com, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series | clk: new APIs to handle all available clocks | expand |
Quoting Dong Aisheng (2018-08-30 21:45:53) > 'clock-names' property is optional in DT, so of_clk_bulk_get() is > introduced here to handle this for DT users without 'clock-names' > specified. Later clk_bulk_get_all() will be implemented on top of > it and this API will be kept private until someone proves they need > it because they don't have a struct device pointer. > > Cc: Stephen Boyd <sboyd@codeaurora.org> > Cc: Michael Turquette <mturquette@baylibre.com> > Cc: Russell King <linux@arm.linux.org.uk> > Reported-by: Shawn Guo <shawnguo@kernel.org> > Tested-by: Thor Thayer <thor.thayer@linux.intel.com> > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> > --- Applied to clk-next
diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c index 6904ed6..4460ac5 100644 --- a/drivers/clk/clk-bulk.c +++ b/drivers/clk/clk-bulk.c @@ -19,6 +19,35 @@ #include <linux/clk.h> #include <linux/device.h> #include <linux/export.h> +#include <linux/of.h> + +static int __must_check of_clk_bulk_get(struct device_node *np, int num_clks, + struct clk_bulk_data *clks) +{ + int ret; + int i; + + for (i = 0; i < num_clks; i++) + clks[i].clk = NULL; + + for (i = 0; i < num_clks; i++) { + clks[i].clk = of_clk_get(np, i); + if (IS_ERR(clks[i].clk)) { + ret = PTR_ERR(clks[i].clk); + pr_err("%pOF: Failed to get clk index: %d ret: %d\n", + np, i, ret); + clks[i].clk = NULL; + goto err; + } + } + + return 0; + +err: + clk_bulk_put(i, clks); + + return ret; +} void clk_bulk_put(int num_clks, struct clk_bulk_data *clks) {