From: Tony Lindgren <tony@atomide.com>
To: Nishanth Menon <nm@ti.com>
Cc: l-o <linux-omap@vger.kernel.org>, Kevin H <khilman@deeprootsystems.com>
Subject: Re: [PATCH 3/3 v2] OMAP3: remove OPP interfaces from OMAP PM layer
Date: Thu, 4 Nov 2010 16:20:06 -0700 [thread overview]
Message-ID: <20101104232005.GF9264@atomide.com> (raw)
In-Reply-To: <1287536543-9729-4-git-send-email-nm@ti.com>
* Nishanth Menon <nm@ti.com> [101019 17:53]:
> static int __init omap2_common_pm_init(void)
> {
> omap2_init_processor_devices();
> +
> + if (cpu_is_omap34xx() || cpu_is_omap44xx())
> + omap_init_opp_table();
> +
> omap_pm_if_init();
It's best to have separate init for each supported processor instead:
static init __init omap3_opp_init(void)
{
if (cpu_is_not_omap34xx())
return -ENODEV;
/* Do omap3 specific init */
...
return omap_opp_init(omap3_opp_def_list);
}
device_initcall(omap3_opp_init);
static init __init omap4_opp_init(void)
{
if (cpu_is_not_omap44xx())
return -ENODEV;
/* Do omap3 specific init */
...
return omap_opp_init(omap4_opp_def_list);
}
device_initcall(omap4_opp_init);
...
This way it's easier to add support for new processors by
implementing the necessary initcalls, common code stays
generic, one level of code indentation is avoided, and
the code still gets optimized out for unselected processors.
Regards,
Tony
next prev parent reply other threads:[~2010-11-04 23:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-20 1:02 [PATCH 0/3 v2] omap: opp: Add opp data Nishanth Menon
2010-10-20 1:02 ` [PATCH 1/3 v2] omap: opp: add OMAP3 OPP table data and common init Nishanth Menon
2010-10-20 1:02 ` [PATCH 2/3 v2] omap4: opp: add OPP table data Nishanth Menon
2010-10-20 1:02 ` [PATCH 3/3 v2] OMAP3: remove OPP interfaces from OMAP PM layer Nishanth Menon
2010-11-04 23:20 ` Tony Lindgren [this message]
2010-11-04 23:13 ` [PATCH 2/3 v2] omap4: opp: add OPP table data Tony Lindgren
2010-11-05 0:05 ` Menon, Nishanth
2010-11-04 23:10 ` [PATCH 1/3 v2] omap: opp: add OMAP3 OPP table data and common init Tony Lindgren
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=20101104232005.GF9264@atomide.com \
--to=tony@atomide.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
/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