From patchwork Fri May 19 13:49:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 9737303 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8194B601A1 for ; Fri, 19 May 2017 13:49:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6452628881 for ; Fri, 19 May 2017 13:49:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58C8E28928; Fri, 19 May 2017 13:49:50 +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=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 89F3128881 for ; Fri, 19 May 2017 13:49:49 +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=HnyCrfUvVXw5j+QqvCg92JlEI7Sivx1qVvlCtpcIEnk=; b=Zdqb86/NHWQDgT iMYW26qHpfosmHu2AjhQhvpErd7oTQF1YjvSBkYLz28DVBrSwlqMdh3z3GF+bp+/rrT+bQgIOT6tC LtIT7s/8/FjlUR5Ipl2uCLodUUgyzfU1nwUOs/VVoBwSz+bCiSSL7s90sAxM1mOpUYv8h4X6xCpZ1 JqwSSmNyjz+h30G6Zm6dkjR08Ll06xOE0kbzDYMqwIgRpIhgnaCDGP68yBkQ9jhN9Tk1K0c0pOfQa qSfltM/ijEoAOlPvLoAUd9ok4HfSmZFeLZ3ofFX5sdnARSP+qHvXvaOtpYeTybvuC36dpyIG+ZxmV Rp/MJiz9GfeZoyzvcwqg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dBiHs-0006CT-Ef; Fri, 19 May 2017 13:49:48 +0000 Received: from mail-dm3nam03on0627.outbound.protection.outlook.com ([2a01:111:f400:fe49::627] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dBiHm-0005j7-4J for linux-arm-kernel@lists.infradead.org; Fri, 19 May 2017 13:49:45 +0000 Received: from CY1PR03CA0022.namprd03.prod.outlook.com (10.174.128.32) by BY1PR0301MB0902.namprd03.prod.outlook.com (10.160.195.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Fri, 19 May 2017 13:49:20 +0000 Received: from BN1BFFO11FD015.protection.gbl (2a01:111:f400:7c10::1:162) by CY1PR03CA0022.outlook.office365.com (2603:10b6:600::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14 via Frontend Transport; Fri, 19 May 2017 13:49:19 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; arm.linux.org.uk; dkim=none (message not signed) header.d=none; arm.linux.org.uk; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD015.mail.protection.outlook.com (10.58.144.78) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1075.5 via Frontend Transport; Fri, 19 May 2017 13:49:18 +0000 Received: from b29396-OptiPlex-7040.ap.freescale.net (b29396-OptiPlex-7040.ap.freescale.net [10.192.242.182]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v4JDmtEO032293; Fri, 19 May 2017 06:49:12 -0700 From: Dong Aisheng To: Subject: [PATCH V3 2/3] clk: add managed version of clk_bulk_get Date: Fri, 19 May 2017 21:49:05 +0800 Message-ID: <1495201746-31841-3-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495201746-31841-1-git-send-email-aisheng.dong@nxp.com> References: <1495201746-31841-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131396753587572418; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39410400002)(39450400003)(39840400002)(39380400002)(39400400002)(39850400002)(2980300002)(1110001)(1109001)(339900001)(54534003)(189002)(199003)(9170700003)(498600001)(48376002)(76176999)(50986999)(5660300001)(110136004)(2906002)(53936002)(38730400002)(85426001)(356003)(50466002)(81166006)(8676002)(39060400002)(305945005)(50226002)(8936002)(2351001)(77096006)(189998001)(4326008)(105606002)(47776003)(5003940100001)(7416002)(33646002)(36756003)(54906002)(86362001)(8656002)(106466001)(6916009)(104016004)(6666003)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0301MB0902; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD015; 1:5N7r9JPrCeylbC5xJKzI25tqNpcEk6s4eouJ+sAFnyMuMnh4C+UYSARzkBDYgt8YYU8U5DoRJ1U37uD9Z8WnK2MNq8ZLTPA9ioODYqZy/W0yayTp07ae1X1sjvxPHlZk5z/8Ilyhy4QLUivbr3R9A5JVvmgs2Iqr9PwY0zEuLmox96j+pFTLy0VHoOSfDwMt6Q8GBxenesusOWBP86fPlcf77d1FKgfUNT0E3GhZm1SqBAbyGu31irqIL4CEYQJSEkVzBq97c0vfOHAadEhePUoyJkxf2PhPwFrJGZHz8Jurt0hMhEgjY4nS9jfN5mir18JsmeXmuk9IiNR9VJ0seSS7hBkDt0K6nd95wx9cDGjOVqjfdiuLWV2g27eYrFBIjNF2GwrYIkIxtRsMukLx5CnKuOshxx4opqTtIR91q3JBnryN3YiEZxn+BpLP1WsvGPYkzH59jg2MxHrz2NOvii2b6Vo2y5Z0pnOarJkQCQViBChNfR4Mpz+vFZeq+1h08aOCI+WwYzJYH/XkVur9xxh9XhjrzIKtxUtq+rbhpO3fS59TbW0KCPDFGujnrn99UmW0ZPANJ+JoaahCQzLR6R+7w4orZ7vQ37uRTjhpoo63E2QDhWCyFMoqFs2Km6ey MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b8ccdd77-cf7a-41a4-0ec2-08d49ebdd8b1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BY1PR0301MB0902; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0902; 3:ooqbIygdp9RbGmRjdEcPy7tl/eoQqSRZ0ds/sShDjQoxxIF3lQlES1bNPcEJwRPC8gHVAt/yM2+oeDO3HGBfjPK9n/rAFRBzcblLKn5KQQyPmYKst8HO830+tC4fLhnhamLzaeKv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B59aIzFjy759YmqNwDt+Bq5ttQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(13024025)(13023025)(8121501046)(13018025)(5005006)(13015025)(13017025)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123565025)(20161123556025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(20161123561025); SRVR:BY1PR0301MB0902; BCL:0; PCL:0; RULEID:(400006); SRVR:BY1PR0301MB0902; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0301MB0902; 4:EOHaMiBvybl//8qRXAoEJf1gTIpOnXYJhFkM3tWF?= =?us-ascii?Q?Yk2BaQv7DT5cs4PTZF/mncAj9rkEjgLAZyjjoyZgjRU+JKFe1wESOSAQjhzZ?= =?us-ascii?Q?wQW8su4H5Sa+km5WkkIN6EkOwxoOrJ65+xniWdr5RQr76Ym/PbnoOL794/Ci?= =?us-ascii?Q?Q1pMmbWla0pH/NXaZXFdXhomMuFgx2PrlIxBMcs7jLnnuhldWnXBj6MVl866?= =?us-ascii?Q?va08xMbmU62buL24rAeHZQF2qcjtsD4BxoTM1Vi5+87bgaxwVhncf/O9DgsK?= =?us-ascii?Q?gkL5K4AK96I1A7RvrnGfjPJdi9hlyUZd5CogxIb3h34u0xPDy4mELrNi4Orj?= =?us-ascii?Q?ePJSicWso8fcS6vfwDlA23H/N7iAKQ84iP6s1kDEh7g/K6pnVcSosSD3telH?= =?us-ascii?Q?zJlL/Ur7djmAl97S0lARZUAXlthlrrva/M8CYAc/wF22aJldoCgQ7m/Yb0n+?= =?us-ascii?Q?5siWkrC5x+4Fr+BnLW2upVD2EhOeX0ctDhll7ornG+Tk54spTRebrXPVtQy1?= =?us-ascii?Q?q1111kvFJn2+9R7AxXySXa9psJCTs4rovK6B1PsliUGNXlAChGzKRGn6nrpy?= =?us-ascii?Q?odxThXqNi270VZCAVd96El4mP9gjlPdeyj9fuZA0OVI4CWdra1TkHvn6Pz3H?= =?us-ascii?Q?o67k7ggT+Y4DuUPkvYMRz0SCz5goyhyaT/y/fEnWryh9iIA8d3CKQHYI3k1Q?= =?us-ascii?Q?Azy7sp4E2U7sqxrw/hcmUbZqK3BEmR8xe2goSNVr2WxsAl+HMacna/fdSXbu?= =?us-ascii?Q?SVFku/OjicrkuQCfa7IYDZpZeX3pD4yFzNztYPdSjLUGxnev7KL7tcd9ZzJZ?= =?us-ascii?Q?KZvqkzK8ONigEWw1YcznLXhJ16/i86ma2bTrHPqh3CnAW6UYgDB3G8m9w1u5?= =?us-ascii?Q?vlweELGlss95pWI7cWiga5KJJ5zmXnQt+cRD5UQD0RWjsagjF4vnxWW60aaK?= =?us-ascii?Q?BRpwJfH4Da+nxJkFTrmsZzT2IBOCS3CS1nFrn/1xww=3D=3D?= X-Forefront-PRVS: 031257FE13 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0301MB0902; 23:wrQlMa/iXLNUcwY8ImCUcPbQhnv5G8IZfuMwt9K?= =?us-ascii?Q?Owc+0kdsPUMi3sFGUoUA4ma7cXBRpSs4+q5aKdWloZar7e6+U2uAXNqSVTnp?= =?us-ascii?Q?JSJ63gGX/rPNAKCmPwloE+JgG7qEUdP+hYqIYvmekBzRb2QxYFu/tooeL4Mu?= =?us-ascii?Q?19jIy86Irtn+5HlADjrBCm1AB6mMISGd8ZA/MsTXgCovmSWla1ZIblJUS6Pc?= =?us-ascii?Q?PFn4Rkej2/Vbfw8rEG8S54CWsVHs0PkPdq7b6EYF4qjBC369IpY35ky43+2y?= =?us-ascii?Q?zz+apHTV27H0zRwv6yi2hmPiNKlp6omvNoVs0O3N/z/j+yZZUP0BdhSH/GDE?= =?us-ascii?Q?oRussn8lnpZQx7e1GcPVHjdxPitAptSMppyPOFVP8BxVUIsasySez2evnkZZ?= =?us-ascii?Q?EzP80wnVYbyJY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CPRvRJEFo+V?= =?us-ascii?Q?OXKDaqblfwF0kyxPeuN7lVBA=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0902; 6:LndsPxRnZHcGU+379/BEsiGIGSBlV4oJJmyweXC1e4U7cLrpq0+9ZJCxre3I7DurcskaKr3cXuk7kLRfdDsbMs4h31l98vOSG6wCSGex5DVycs8TtHfxWJcSLAL2BovhenPoZ3Idars4la60mhRV+VW8ubjIUwtER0OgNUc+ihJaCSWNWgCwsKmyYoy626SGbncKEoCfFv5I7iFp8tscfAJNJiNQvhnXsJvzsfWkfElh3jXy4BcfEA+iN9Ovo0uXT3EdjA2gaCvK/QGreiYAi3ojOPSFaT0J6on/IAldrZbt77mxXuaWUBhvdugerKyZKJTo+ur5tpfk5EGvMWu4Kg6FGOjsPJXYD4hjreK34ozHyYnh5tyLg151hEBHiXp1dA9G7Bh9zeXD/nsmXhx7aHVGBZEIkenAxpU1sez1gtVkUxljYslilxt2LPCEnfO/uSNXMcQ0j0tuVptX15Vcdqf49or2B6hGpZdkE6KS2pljQYc8DpVbsZnXtMrNNOCvt7EzIbYPWWy4eFiRlKST6g==; 5:vqHQrOyd63ieJca9Jn4ObBXg57Qrw/5Bp3AYUHJoHY7fZWgrHR9CRTE2bw0rVt7ILMe653V0WSUb99RboDOXcxFsVe4Kz3VsZgM8joay9reY4asn56CkuhcI6fuzw0TRKW7TVxf7acn72xUReOu61IORQmPE9odNZz2UFLO+1PGacJbneceELDiN5pX3wNWy; 24:XqpwD9n7ASW5qufJ4J2g5wkGdk7GxjclX684ivAT5S/5t4OKRxhXicXk5kS98MPmUCuJnyGB4WyjYxW2WVGeOcouEtF2dEUNdevS6dmRvT0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0902; 7:MK1i/9LOGrgwNpAk3iOuD3JJHunCFwTgKuBhdsN/1gpugJq8JKAGZh2nzsgXYg9HRYO3i+i0Nnq7Af9ZWXYPeXcG/OQo+gizT7k+k8REc0qak2aHjdjdefYzBZFHf8CZGVV9SG5tVovbMnyOdX4JT3jPNPTNS1GjD8j/BoxXyn5pzRdl4Vj7mPhccYH0ZPw1BPXOorRL6vMMwyGPcczjpG0vpmD5QKW0Hu7u2HlMrY+NhZPHCS9Zny+gyeaBhylMDUvlN2kj1yWFSGAXEpbWRULFQ0orpXLtcdyg8GFdaOFH1Ggkzng2uCUwEo1te6L7esxOM2lWeVfTxQrqxKXVJA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2017 13:49:18.3672 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB0902 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170519_064942_661601_8682E0D9 X-CRM114-Status: GOOD ( 17.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aisheng.dong@nxp.com, leonard.crestez@nxp.com, Russell King , ping.bai@nxp.com, anson.huang@nxp.com, viresh.kumar@linaro.org, mturquette@baylibre.com, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, broonie@kernel.org, geert@linux-m68k.org, octavian.purdila@nxp.com, kernel@pengutronix.de, fabio.estevam@nxp.com, f.fainelli@gmail.com, yibin.gong@nxp.com, shawnguo@kernel.org, sboyd@codeaurora.org, linux-arm-kernel@lists.infradead.org, dongas86@gmail.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces the managed version of clk_bulk_get. Cc: Michael Turquette Cc: Stephen Boyd Cc: Russell King Cc: Geert Uytterhoeven Cc: "Rafael J. Wysocki" Cc: Viresh Kumar Cc: Mark Brown Cc: Shawn Guo Cc: Fabio Estevam Cc: Sascha Hauer Cc: Anson Huang Cc: Robin Gong Cc: Bai Ping Cc: Leonard Crestez Cc: Octavian Purdila Signed-off-by: Dong Aisheng --- ChangeLog: v2->v3: no changes v1->v2: only one minor comment change --- drivers/clk/clk-devres.c | 36 ++++++++++++++++++++++++++++++++++++ include/linux/clk.h | 21 +++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c index 3a218c3..d854e26 100644 --- a/drivers/clk/clk-devres.c +++ b/drivers/clk/clk-devres.c @@ -34,6 +34,42 @@ struct clk *devm_clk_get(struct device *dev, const char *id) } EXPORT_SYMBOL(devm_clk_get); +struct clk_bulk_devres { + struct clk_bulk_data *clks; + int num_clks; +}; + +static void devm_clk_bulk_release(struct device *dev, void *res) +{ + struct clk_bulk_devres *devres = res; + + clk_bulk_put(devres->num_clks, devres->clks); +} + +int __must_check devm_clk_bulk_get(struct device *dev, int num_clks, + struct clk_bulk_data *clks) +{ + struct clk_bulk_devres *devres; + int ret; + + devres = devres_alloc(devm_clk_bulk_release, + sizeof(*devres), GFP_KERNEL); + if (!devres) + return -ENOMEM; + + ret = clk_bulk_get(dev, num_clks, clks); + if (!ret) { + devres->clks = clks; + devres->num_clks = num_clks; + devres_add(dev, devres); + } else { + devres_free(devres); + } + + return ret; +} +EXPORT_SYMBOL_GPL(devm_clk_bulk_get); + static int devm_clk_match(struct device *dev, void *res, void *data) { struct clk **c = res; diff --git a/include/linux/clk.h b/include/linux/clk.h index 1201944..1ebccf3 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -281,6 +281,21 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks, struct clk_bulk_data *clks); /** + * devm_clk_bulk_get - managed get multiple clk consumers + * @dev: device for clock "consumer" + * @num_clks: the number of clk_bulk_data + * @clks: the clk_bulk_data table of consumer + * + * Return 0 on success, an errno on failure. + * + * This helper function allows drivers to get several clk + * consumers in one operation with management, the clks will + * automatically be freed when the device is unbound. + */ +int __must_check devm_clk_bulk_get(struct device *dev, int num_clks, + struct clk_bulk_data *clks); + +/** * devm_clk_get - lookup and obtain a managed reference to a clock producer. * @dev: device for clock "consumer" * @id: clock consumer ID @@ -550,6 +565,12 @@ static inline struct clk *devm_clk_get(struct device *dev, const char *id) return NULL; } +static inline int devm_clk_bulk_get(struct device *dev, int num_clks, + struct clk_bulk_data *clks) +{ + return 0; +} + static inline struct clk *devm_get_clk_from_child(struct device *dev, struct device_node *np, const char *con_id) {