From patchwork Thu Nov 22 05:34:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 1782941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 796463FC64 for ; Thu, 22 Nov 2012 05:38:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TbPRG-0004ej-RI; Thu, 22 Nov 2012 05:35:02 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TbPR4-0004dG-QN for linux-arm-kernel@lists.infradead.org; Thu, 22 Nov 2012 05:34:52 +0000 Received: by mail-pb0-f49.google.com with SMTP id un15so5182998pbc.36 for ; Wed, 21 Nov 2012 21:34:48 -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=nOYRwELRksX0tF7c8zM9jRq5GTBSubJsA4k6iUeBOrc=; b=XzeLk09eWvQEj1aQk3ss5Z7EFRub+MroQHyMPrHTBiKK5gyE2NOSAz4b6DLAL6Pohk TgN1/z4KcUNrjANAxVd2rtVWi5tYcXnAQT/xbYFcXpi5KlX9g3ok6VoOsYCzziDKqY+y 9Wx6UXRwf9g89uepKQMaxj71C/1pr8zQJdlCKZZO7sscP6ZypXBJLhbcMurMjmNO9ZJJ D4VvAUy4XSZL7kOTYip0B3PJgfmVbRmf3Bf0Bgs4nV0IaHrU8Ovxew6Mt52lRr1Tuch2 WGvP9ZM12ARixmUpaCXF61U0w0Fanlbe6vMZEBRTjFz1Rq3WhfPos801aIz0Ifm4lPHR 2Ekg== Received: by 10.68.143.201 with SMTP id sg9mr1562905pbb.32.1353562488167; Wed, 21 Nov 2012 21:34:48 -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 oi2sm1440914pbb.62.2012.11.21.21.34.45 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 21:34:46 -0800 (PST) From: Dmitry Torokhov To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/3] CLK: get rid of HAVE_CLK_PREPARE Date: Wed, 21 Nov 2012 21:34:40 -0800 Message-Id: <1353562482-12422-2-git-send-email-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1353562482-12422-1-git-send-email-dmitry.torokhov@gmail.com> References: <1353403339-11679-1-git-send-email-dmitry.torokhov@gmail.com> <1353562482-12422-1-git-send-email-dmitry.torokhov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121122_003451_022195_9B6C3403 X-CRM114-Status: GOOD ( 14.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.160.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 , Shawn Guo , 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 HAVE_CLK_PREPARE is automatically selected by COMMON_CLK and the only platform that explicitly selects HAVE_CLK_PREPARE is MXS which has been switched to common clk framework, so we can delete this option now. As part of this change we move declarations of clk_prepare() and clk_unprepare() under HAVE_CLK and provide stubs if this option is not enabled. Reviewed-by: Viresh Kumar Signed-off-by: Dmitry Torokhov Acked-by: Shawn Guo --- arch/arm/Kconfig | 1 - drivers/clk/Kconfig | 4 ---- include/linux/clk.h | 68 +++++++++++++++++++++++++---------------------------- 3 files changed, 32 insertions(+), 41 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ade7e92..ae6c1df 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -453,7 +453,6 @@ config ARCH_MXS select CLKSRC_MMIO select COMMON_CLK select GENERIC_CLOCKEVENTS - select HAVE_CLK_PREPARE select MULTI_IRQ_HANDLER select PINCTRL select SPARSE_IRQ diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index bace9e9..639ee9d 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -3,15 +3,11 @@ config CLKDEV_LOOKUP bool select HAVE_CLK -config HAVE_CLK_PREPARE - bool - config HAVE_MACH_CLKDEV bool config COMMON_CLK bool - select HAVE_CLK_PREPARE select CLKDEV_LOOKUP ---help--- The common clock framework is a single definition of struct 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;