From patchwork Sat Jun 25 01:17:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: omar ramirez X-Patchwork-Id: 917982 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5P1JoiS006919 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 25 Jun 2011 01:20:11 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QaHX4-0002WR-H3; Sat, 25 Jun 2011 01:19:35 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QaHX2-0004NG-AL; Sat, 25 Jun 2011 01:19:32 +0000 Received: from na3sys009aog114.obsmtp.com ([74.125.149.211]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1QaHVp-000477-S7 for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2011 01:18:20 +0000 Received: from mail-gw0-f53.google.com ([74.125.83.53]) (using TLSv1) by na3sys009aob114.postini.com ([74.125.148.12]) with SMTP ID DSNKTgU3VwL/DcGA8JJM7tSlBC4+P2Hldb4V@postini.com; Fri, 24 Jun 2011 18:18:17 PDT Received: by gwj20 with SMTP id 20so1753669gwj.26 for ; Fri, 24 Jun 2011 18:18:14 -0700 (PDT) Received: by 10.101.9.20 with SMTP id m20mr4197855ani.46.1308964694824; Fri, 24 Jun 2011 18:18:14 -0700 (PDT) Received: from localhost.localdomain (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id r10sm3051365anh.28.2011.06.24.18.18.13 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Jun 2011 18:18:14 -0700 (PDT) From: Omar Ramirez Luna To: Hiroshi Doyu Subject: [RFC PATCH 4/7] OMAP: mailbox: move framework functions under header file Date: Fri, 24 Jun 2011 20:17:40 -0500 Message-Id: <1308964663-5669-5-git-send-email-omar.ramirez@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1308964663-5669-1-git-send-email-omar.ramirez@ti.com> References: <1308964663-5669-1-git-send-email-omar.ramirez@ti.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110624_211818_303825_3DC7ABCD X-CRM114-Status: GOOD ( 11.88 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.211 listed in list.dnswl.org] Cc: Omar Ramirez Luna , Russell King , Benoit Cousson , Fernando Guzman Lugo , Tony Lindgren , Felipe Contreras , lo , lak X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 25 Jun 2011 01:20:12 +0000 (UTC) Move API functions to common framework like save/restore_ctx, enable/disable_irq instead of being under a header file. While at it dropping their static inline declarations. Signed-off-by: Omar Ramirez Luna --- arch/arm/plat-omap/include/plat/mailbox.h | 35 +++------------------------- arch/arm/plat-omap/mailbox.c | 35 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 31 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/mailbox.h b/arch/arm/plat-omap/include/plat/mailbox.h index 337b93c..271905a 100644 --- a/arch/arm/plat-omap/include/plat/mailbox.h +++ b/arch/arm/plat-omap/include/plat/mailbox.h @@ -78,36 +78,9 @@ void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb); int omap_mbox_register(struct device *parent, struct omap_mbox **); int omap_mbox_unregister(void); -static inline void omap_mbox_save_ctx(struct omap_mbox *mbox) -{ - if (!mbox->ops->save_ctx) { - dev_err(mbox->dev, "%s:\tno save\n", __func__); - return; - } - - mbox->ops->save_ctx(mbox); -} - -static inline void omap_mbox_restore_ctx(struct omap_mbox *mbox) -{ - if (!mbox->ops->restore_ctx) { - dev_err(mbox->dev, "%s:\tno restore\n", __func__); - return; - } - - mbox->ops->restore_ctx(mbox); -} - -static inline void omap_mbox_enable_irq(struct omap_mbox *mbox, - omap_mbox_irq_t irq) -{ - mbox->ops->enable_irq(mbox, irq); -} - -static inline void omap_mbox_disable_irq(struct omap_mbox *mbox, - omap_mbox_irq_t irq) -{ - mbox->ops->disable_irq(mbox, irq); -} +void omap_mbox_save_ctx(struct omap_mbox *mbox); +void omap_mbox_restore_ctx(struct omap_mbox *mbox); +void omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq); +void omap_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq); #endif /* MAILBOX_H */ diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index 69ddc9f..98b36dc 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c @@ -60,6 +60,18 @@ static inline int mbox_fifo_full(struct omap_mbox *mbox) } /* Mailbox IRQ handle functions */ +void omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) +{ + mbox->ops->enable_irq(mbox, irq); +} +EXPORT_SYMBOL(omap_mbox_enable_irq); + +void omap_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) +{ + mbox->ops->disable_irq(mbox, irq); +} +EXPORT_SYMBOL(omap_mbox_disable_irq); + static inline void ack_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) { if (mbox->ops->ack_irq) @@ -70,6 +82,29 @@ static inline int is_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq) return mbox->ops->is_irq(mbox, irq); } +/* Mailbox context functions */ +void omap_mbox_save_ctx(struct omap_mbox *mbox) +{ + if (!mbox->ops->save_ctx) { + dev_err(mbox->dev, "%s:\tno save\n", __func__); + return; + } + + mbox->ops->save_ctx(mbox); +} +EXPORT_SYMBOL(omap_mbox_save_ctx); + +void omap_mbox_restore_ctx(struct omap_mbox *mbox) +{ + if (!mbox->ops->restore_ctx) { + dev_err(mbox->dev, "%s:\tno restore\n", __func__); + return; + } + + mbox->ops->restore_ctx(mbox); +} +EXPORT_SYMBOL(omap_mbox_restore_ctx); + /* * message sender */