From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] ARM: shmobile: Build code depending on PM only if PM is set
Date: Mon, 09 Jul 2012 08:13:01 +0000 [thread overview]
Message-ID: <201207091013.01271.rjw@sisk.pl> (raw)
In-Reply-To: <201207090015.12531.rjw@sisk.pl>
On Monday, July 09, 2012, Simon Horman wrote:
> On Mon, Jul 09, 2012 at 12:15:12AM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> >
> > 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 <rjw@sisk.pl>
> > ---
> > 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(-)
> >
> > 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) {}
>
> This seems to slightly alter the behaviour in the case where
> CONFIG_PM is not set. I'm unsure if that is a problem or not.
I don't think it would be a problem, all of those settings are PM-related.
Magnus, what do you think?
Thanks,
Rafael
> > +#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 <linux/console.h>
> > #include <mach/pm-rmobile.h>
> >
> > -#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)
> > {
> > --
> > 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
> >
>
>
next prev parent reply other threads:[~2012-07-09 8:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-08 22:15 [PATCH] ARM: shmobile: Build code depending on PM only if PM is set Rafael J. Wysocki
2012-07-09 1:19 ` Simon Horman
2012-07-09 8:13 ` Rafael J. Wysocki [this message]
2012-07-09 9:56 ` Magnus Damm
2012-07-09 16:49 ` Rafael J. Wysocki
2012-09-11 20:44 ` Rafael J. Wysocki
2012-09-12 0:23 ` Simon Horman
-- strict thread matches above, loose matches on Subject: below --
2012-09-11 6:51 Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201207091013.01271.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).