From patchwork Sun Jul 8 22:15:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 1170451 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A475940B21 for ; Sun, 8 Jul 2012 22:20:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752556Ab2GHWKT (ORCPT ); Sun, 8 Jul 2012 18:10:19 -0400 Received: from ogre.sisk.pl ([193.178.161.156]:58524 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752502Ab2GHWJi (ORCPT ); Sun, 8 Jul 2012 18:09:38 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id 84C031DA960; Mon, 9 Jul 2012 00:09:08 +0200 (CEST) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18450-02; Mon, 9 Jul 2012 00:08:59 +0200 (CEST) Received: from ferrari.rjw.lan (62-121-64-87.home.aster.pl [62.121.64.87]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id 76B371DA85B; Mon, 9 Jul 2012 00:08:59 +0200 (CEST) From: "Rafael J. Wysocki" To: "Linux-sh list" Subject: [PATCH] ARM: shmobile: Build code depending on PM only if PM is set Date: Mon, 9 Jul 2012 00:15:12 +0200 User-Agent: KMail/1.13.6 (Linux/3.5.0-rc5+; KDE/4.6.0; x86_64; ; ) Cc: Linux PM list , Magnus Damm , Kuninori Morimoto MIME-Version: 1.0 Message-Id: <201207090015.12531.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Rafael J. Wysocki There are a few files under arch/arm/mach-shmobile/ whose entire contents depend on CONFIG_PM, but they are compiled even if CONFIG_PM is unset. It is cleaner to modify the Makefile to avoid building those files entirely for CONFIG_PM unset and remove #ifdef CONFIG_PM directives from them. Signed-off-by: Rafael J. Wysocki --- arch/arm/mach-shmobile/Makefile | 4 +++- arch/arm/mach-shmobile/include/mach/common.h | 4 ++++ arch/arm/mach-shmobile/pm-r8a7740.c | 3 --- arch/arm/mach-shmobile/pm-rmobile.c | 2 -- arch/arm/mach-shmobile/pm-sh7372.c | 4 ---- 5 files changed, 7 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux/arch/arm/mach-shmobile/Makefile =================================================================== --- linux.orig/arch/arm/mach-shmobile/Makefile +++ linux/arch/arm/mach-shmobile/Makefile @@ -37,11 +37,13 @@ obj-$(CONFIG_ARCH_SH7372) += entry-intc. obj-$(CONFIG_ARCH_R8A7740) += entry-intc.o # PM objects -obj-$(CONFIG_SUSPEND) += suspend.o obj-$(CONFIG_CPU_IDLE) += cpuidle.o +ifeq ($(CONFIG_PM),y) +obj-$(CONFIG_SUSPEND) += suspend.o obj-$(CONFIG_ARCH_SHMOBILE) += pm-rmobile.o obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o +endif obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o # Board objects Index: linux/arch/arm/mach-shmobile/include/mach/common.h =================================================================== --- linux.orig/arch/arm/mach-shmobile/include/mach/common.h +++ linux/arch/arm/mach-shmobile/include/mach/common.h @@ -41,7 +41,11 @@ extern void sh7372_add_early_devices(voi extern void sh7372_add_standard_devices(void); extern void sh7372_clock_init(void); extern void sh7372_pinmux_init(void); +#ifdef CONFIG_PM extern void sh7372_pm_init(void); +#else +static inline void sh7372_pm_init(void) {} +#endif extern void sh7372_resume_core_standby_sysc(void); extern int sh7372_do_idle_sysc(unsigned long sleep_mode); extern struct clk sh7372_extal1_clk; Index: linux/arch/arm/mach-shmobile/pm-r8a7740.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/pm-r8a7740.c +++ linux/arch/arm/mach-shmobile/pm-r8a7740.c @@ -11,7 +11,6 @@ #include #include -#ifdef CONFIG_PM static int r8a7740_pd_a4s_suspend(void) { /* @@ -50,5 +49,3 @@ struct rmobile_pm_domain r8a7740_pd_a4lc .genpd.name = "A4LC", .bit_shift = 1, }; - -#endif /* CONFIG_PM */ Index: linux/arch/arm/mach-shmobile/pm-rmobile.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/pm-rmobile.c +++ linux/arch/arm/mach-shmobile/pm-rmobile.c @@ -27,7 +27,6 @@ #define PSTR_RETRIES 100 #define PSTR_DELAY_US 10 -#ifdef CONFIG_PM static int rmobile_pd_power_down(struct generic_pm_domain *genpd) { struct rmobile_pm_domain *rmobile_pd = to_rmobile_pd(genpd); @@ -164,4 +163,3 @@ void rmobile_pm_add_subdomain(struct rmo { pm_genpd_add_subdomain(&rmobile_pd->genpd, &rmobile_sd->genpd); } -#endif /* CONFIG_PM */ Index: linux/arch/arm/mach-shmobile/pm-sh7372.c =================================================================== --- linux.orig/arch/arm/mach-shmobile/pm-sh7372.c +++ linux/arch/arm/mach-shmobile/pm-sh7372.c @@ -69,8 +69,6 @@ /* AP-System Core */ #define APARMBAREA 0xe6f10020 -#ifdef CONFIG_PM - struct rmobile_pm_domain sh7372_pd_a4lc = { .genpd.name = "A4LC", .bit_shift = 1, @@ -149,8 +147,6 @@ struct rmobile_pm_domain sh7372_pd_a3sg .bit_shift = 13, }; -#endif /* CONFIG_PM */ - #ifdef CONFIG_SUSPEND static void sh7372_set_reset_vector(unsigned long address) {