linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: OMAP2: twl-common: fix compiler warnings
Date: Fri, 6 Jul 2012 13:02:34 +0300	[thread overview]
Message-ID: <1341568954.2059.214.camel@sokoban> (raw)
In-Reply-To: <20120706085357.GS1122@atomide.com>

On Fri, 2012-07-06 at 01:53 -0700, Tony Lindgren wrote:
> * Tero Kristo <t-kristo@ti.com> [120628 03:54]:
> > OMAP2 does not use the external voltage controller code for TWL, and
> > thus OMAP2 only compilation generates following warnings:
> 
> Hmm well omap2420 does not have twl, but 2430 usually has. So do you
> mean that 2430 does not use the external voltage controller code?

Well, at least currently the external controller code is not used on any
omap2xxx chip. I guess it might be possible to extend the support for
omap2 also, but I don't know who can do that (personally I have no
access to omap2 hw.)

> 
> > arch/arm/mach-omap2/twl-common.c:51: warning: 'twl_set_voltage' defined but not used
> > arch/arm/mach-omap2/twl-common.c:57: warning: 'twl_get_voltage' defined but not used
> > 
> > This patch moves the code in question behind ARCH specific flags and
> > eliminates these warnings.
> ...
> 
> > --- a/arch/arm/mach-omap2/twl-common.c
> > +++ b/arch/arm/mach-omap2/twl-common.c
> > @@ -48,6 +48,7 @@ static struct i2c_board_info __initdata omap4_i2c1_board_info[] = {
> >  	},
> >  };
> >  
> > +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
> >  static int twl_set_voltage(void *data, int target_uV)
> >  {
> >  	struct voltagedomain *voltdm = (struct voltagedomain *)data;
> > @@ -59,6 +60,7 @@ static int twl_get_voltage(void *data)
> >  	struct voltagedomain *voltdm = (struct voltagedomain *)data;
> >  	return voltdm_get_voltage(voltdm);
> >  }
> > +#endif
> 
> To avoid patching this piece of code for new SoCs, can we make it
> ifndef CONFIG_ARCH_OMAP2? Also in the makefile we should not even
> build twl-common.o for 2420 only builds..

Can't make it ifndef CONFIG_ARCH_OMAP2, as this would break on
omap2plus_defconfig then... as it defines all ARCH_OMAP2...ARCH_OMAP4.

And... can't drop it from makefile either, as parts of the code from
twl-common.c are still used with omap2 (omap_pmic_init &
omap_pmic_late_init). These would need to be moved elsewhere first.

-Tero

  reply	other threads:[~2012-07-06 10:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28 10:49 [PATCH] ARM: OMAP2: twl-common: fix compiler warnings Tero Kristo
2012-06-29 22:42 ` Paul Walmsley
2012-07-06  8:53 ` Tony Lindgren
2012-07-06 10:02   ` Tero Kristo [this message]
2012-07-06 10:07 ` Peter Ujfalusi

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=1341568954.2059.214.camel@sokoban \
    --to=t-kristo@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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).