From patchwork Wed Jan 11 14:55:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 6157 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7E0ED23E0E for ; Wed, 11 Jan 2012 14:55:55 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 6D60BA1853D for ; Wed, 11 Jan 2012 14:55:55 +0000 (UTC) Received: by mail-bk0-f52.google.com with SMTP id zu5so737213bkb.11 for ; Wed, 11 Jan 2012 06:55:55 -0800 (PST) Received: by 10.204.41.143 with SMTP id o15mr6287955bke.63.1326293755278; Wed, 11 Jan 2012 06:55:55 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs110609bkc; Wed, 11 Jan 2012 06:55:55 -0800 (PST) Received: by 10.180.105.129 with SMTP id gm1mr13251109wib.1.1326293753968; Wed, 11 Jan 2012 06:55:53 -0800 (PST) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id u47si787647weq.26.2012.01.11.06.55.53 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jan 2012 06:55:53 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-we0-f178.google.com with SMTP id p12so799825wer.37 for ; Wed, 11 Jan 2012 06:55:53 -0800 (PST) Received: by 10.216.136.23 with SMTP id v23mr2897598wei.48.1326293753054; Wed, 11 Jan 2012 06:55:53 -0800 (PST) Received: from localhost.localdomain (AToulouse-159-1-69-110.w92-134.abo.wanadoo.fr. [92.134.92.110]) by mx.google.com with ESMTPS id a6sm4608647wiy.6.2012.01.11.06.55.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jan 2012 06:55:52 -0800 (PST) From: Daniel Lezcano To: linux@arm.linux.org.uk Cc: robherring2@gmail.com, khilman@ti.com, len.brown@intel.com, linux-pm@vger.kernel.org, magnus.damm@gmail.com, s.hauer@pengutronix.de, nicolas.ferre@atmel.com, nsekhar@ti.com, linux@maxim.org.za, arnd.bergmann@linaro.org, rob.lee@linaro.org, shawn.guo@freescale.com, linux-arm-kernel@lists.infradead.org, amit.kucheria@linaro.org Subject: [PATCH 4/7] at91 : convert pm.h macros to static inline functions Date: Wed, 11 Jan 2012 15:55:37 +0100 Message-Id: <1326293740-15735-5-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1326293740-15735-1-git-send-email-daniel.lezcano@linaro.org> References: <1326293740-15735-1-git-send-email-daniel.lezcano@linaro.org> Change the macros to inline functions. That will allow to group the different functions definitions in a single function. Signed-off-by: Daniel Lezcano --- arch/arm/mach-at91/pm.h | 52 +++++++++++++++++++++++++++++----------------- 1 files changed, 33 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h index fc48bef..3aa8b66 100644 --- a/arch/arm/mach-at91/pm.h +++ b/arch/arm/mach-at91/pm.h @@ -34,12 +34,15 @@ static inline u32 sdram_selfrefresh_enable(void) return saved_lpr; } -#define sdram_selfrefresh_disable(saved_lpr) \ - at91_sys_write(AT91_SDRAMC_LPR, saved_lpr) +static inline void sdram_selfrefresh_disable(u32 saved_lpr) +{ + at91_sys_write(AT91_SDRAMC_LPR, saved_lpr); +} -#define wait_for_interrupt_enable() \ - asm volatile ("mcr p15, 0, %0, c7, c0, 4" \ - : : "r" (0)) +static inline void wait_for_interrupt_enable(void) +{ + asm volatile ("mcr p15, 0, %0, c7, c0, 4" : : "r" (0)); +} #elif defined(CONFIG_ARCH_AT91CAP9) @@ -55,11 +58,15 @@ static inline u32 sdram_selfrefresh_enable(void) return saved_lpr; } -#define sdram_selfrefresh_disable(saved_lpr) \ - at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr) +static inline void sdram_selfrefresh_disable(u32 saved_lpr) +{ + at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr); +} -#define wait_for_interrupt_enable() \ - cpu_do_idle() +static inline void wait_for_interrupt_enable(void) +{ + cpu_do_idle(); +} #elif defined(CONFIG_ARCH_AT91SAM9G45) @@ -90,13 +97,16 @@ static inline u32 sdram_selfrefresh_enable(void) return saved_lpr0; } -#define sdram_selfrefresh_disable(saved_lpr0) \ - do { \ - at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); \ - at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); \ - } while (0) +static inline void sdram_selfrefresh_disable(u32 saved_lpr0) +{ + at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); + at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); +} -#define wait_for_interrupt_enable() cpu_do_idle() +static inline void wait_for_interrupt_enable(void) +{ + cpu_do_idle(); +} #else @@ -120,11 +130,15 @@ static inline u32 sdram_selfrefresh_enable(void) return saved_lpr; } -#define sdram_selfrefresh_disable(saved_lpr) \ - at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr) +static inline void sdram_selfrefresh_disable(u32 saved_lpr) +{ + at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr); +} -#define wait_for_interrupt_enable() \ - cpu_do_idle() +static inline void wait_for_interrupt_enable(void) +{ + cpu_do_idle(); +} #endif