From patchwork Tue Nov 20 09:22:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 1772141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id A44BDDF2AB for ; Tue, 20 Nov 2012 09:24:39 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tak2Y-0001I4-6S; Tue, 20 Nov 2012 09:22:46 +0000 Received: from mail-da0-f49.google.com ([209.85.210.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tak2I-0001Bx-KN for linux-arm-kernel@lists.infradead.org; Tue, 20 Nov 2012 09:22:32 +0000 Received: by mail-da0-f49.google.com with SMTP id v40so1487184dad.36 for ; Tue, 20 Nov 2012 01:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=+pn4xWJfbvHEoBcm7IJNe9LkLDcQPY8ZHBE7SM4YKKM=; b=VZgNzQB6tRn17C7bPQGoIUhAV/WVwwabPbZkKYHAnYsbq0zQQnrc0QJ80CiQTZ9U+H FNwrGAwSUYBGXXa1U121sRRKzdvoW41o/SIrRxGFVxHgoLF+afeAg5/7Bf69zZF/4TxR ecP2KA+DPqnjnsL5UHJa8uZ1qdh8PgmyiJ9KmJ1HP2g9nIkfjotvzXExKQ3+xFw6SL23 zBADhcLgT98LxDsmA+TWOK7dKle5TcxgotzwU2sk2vHlSRcw14Yf33r49Q8dKsoka9iO 85UxpP3rU7GrtBYkst2SZBF7i4doFe5WOFf5p6duSpmuwa6EoKvE3B7cG/80LZY6zsw0 HEZA== Received: by 10.68.230.105 with SMTP id sx9mr47341592pbc.44.1353403347984; Tue, 20 Nov 2012 01:22:27 -0800 (PST) Received: from mailhub.coreip.homeip.net (c-67-188-112-76.hsd1.ca.comcast.net. [67.188.112.76]) by mx.google.com with ESMTPS id j8sm7767140paz.30.2012.11.20.01.22.25 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 01:22:26 -0800 (PST) From: Dmitry Torokhov To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] CLK: uninline clk_prepare() and clk_unprepare() Date: Tue, 20 Nov 2012 01:22:17 -0800 Message-Id: <1353403339-11679-2-git-send-email-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1353403339-11679-1-git-send-email-dmitry.torokhov@gmail.com> References: <1353403339-11679-1-git-send-email-dmitry.torokhov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121120_042231_189196_213C0C5D X-CRM114-Status: GOOD ( 13.74 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dmitry.torokhov[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Viresh Kumar , Russell King , linux-kernel@vger.kernel.org, Mike Turquette X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We'll need to invoke clk_unprepare() via a pointer in our devm_* conversion so let's uninline the pair. Signed-off-by: Dmitry Torokhov --- drivers/clk/clk.c | 4 ++++ include/linux/clk.h | 68 +++++++++++++++++++++++++---------------------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 56e4495e..1b642f2 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -374,6 +374,7 @@ struct clk *__clk_lookup(const char *name) void __clk_unprepare(struct clk *clk) { +#ifdef CONFIG_HAVE_CLK_PREPARE if (!clk) return; @@ -389,6 +390,7 @@ void __clk_unprepare(struct clk *clk) clk->ops->unprepare(clk->hw); __clk_unprepare(clk->parent); +#endif } /** @@ -412,6 +414,7 @@ EXPORT_SYMBOL_GPL(clk_unprepare); int __clk_prepare(struct clk *clk) { +#ifdef CONFIG_HAVE_CLK_PREPARE int ret = 0; if (!clk) @@ -432,6 +435,7 @@ int __clk_prepare(struct clk *clk) } clk->prepare_count++; +#endif return 0; } diff --git a/include/linux/clk.h b/include/linux/clk.h index b3ac22d..f8204c3 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -84,42 +84,6 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); #endif -/** - * clk_prepare - prepare a clock source - * @clk: clock source - * - * This prepares the clock source for use. - * - * Must not be called from within atomic context. - */ -#ifdef CONFIG_HAVE_CLK_PREPARE -int clk_prepare(struct clk *clk); -#else -static inline int clk_prepare(struct clk *clk) -{ - might_sleep(); - return 0; -} -#endif - -/** - * clk_unprepare - undo preparation of a clock source - * @clk: clock source - * - * This undoes a previously prepared clock. The caller must balance - * the number of prepare and unprepare calls. - * - * Must not be called from within atomic context. - */ -#ifdef CONFIG_HAVE_CLK_PREPARE -void clk_unprepare(struct clk *clk); -#else -static inline void clk_unprepare(struct clk *clk) -{ - might_sleep(); -} -#endif - #ifdef CONFIG_HAVE_CLK /** * clk_get - lookup and obtain a reference to a clock producer. @@ -159,6 +123,27 @@ struct clk *clk_get(struct device *dev, const char *id); struct clk *devm_clk_get(struct device *dev, const char *id); /** + * clk_prepare - prepare a clock source + * @clk: clock source + * + * This prepares the clock source for use. + * + * Must not be called from within atomic context. + */ +int clk_prepare(struct clk *clk); + +/** + * clk_unprepare - undo preparation of a clock source + * @clk: clock source + * + * This undoes a previously prepared clock. The caller must balance + * the number of prepare and unprepare calls. + * + * Must not be called from within atomic context. + */ +void clk_unprepare(struct clk *clk); + +/** * clk_enable - inform the system when the clock source should be running. * @clk: clock source * @@ -292,6 +277,17 @@ static inline void clk_put(struct clk *clk) {} static inline void devm_clk_put(struct device *dev, struct clk *clk) {} +static inline int clk_prepare(struct clk *clk) +{ + might_sleep(); + return 0; +} + +static inline void clk_unprepare(struct clk *clk) +{ + might_sleep(); +} + static inline int clk_enable(struct clk *clk) { return 0;