public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi@nokia.com>
To: "Doyu Hiroshi (Nokia-D/Helsinki)" <hiroshi.doyu@nokia.com>
Cc: "x0095840@ti.com" <x0095840@ti.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"Palande Ameya (Nokia-D/Helsinki)" <ameya.palande@nokia.com>,
	"Contreras Felipe (Nokia-D/Helsinki)"
	<felipe.contreras@nokia.com>
Subject: Re: [PATCH] OMAP3: mailbox initialization for all omap versions
Date: Mon, 29 Mar 2010 10:01:45 +0300	[thread overview]
Message-ID: <20100329070145.GF28825@nokia.com> (raw)
In-Reply-To: <20100329.094017.112623699.Hiroshi.DOYU@nokia.com>

hi,

On Mon, Mar 29, 2010 at 08:40:17AM +0200, Doyu Hiroshi (Nokia-D/Helsinki) wrote:
>> From 47783fc3e030d4e49d20ba412661cc1f38d8aec0 Mon Sep 17 00:00:00 2001
>> From: Fernando Guzman Lugo <x0095840@ti.com>
>> Date: Fri, 26 Mar 2010 13:06:32 -0600
>> Subject: [PATCH] OMAP3: mailbox initialization for all omap versions
>>
>> This removes the check for omap2420, omap3430, omap44xx
>> and initialize mailbox for all versions
>>
>> Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
>
>It seems that I missed one point previously when I commented. I have
>just now found that "multi omap arch support" for mailbox is broken at
>the previous commit:454bf340c986b798cd4c2fd676caffa2c1e61482
>
>Considering to fix the above to keep "multi omap arch support", "omap
>cpu type check" is necessary here. Could this be fixed as something below?
>
>#if defined(CONFIG_ARCH_OMAP2)
>static struct resource omap2_mbox_resources[] = {
>       ...
>};
>#endif
>
>#if defined(CONFIG_ARCH_OMAP3)
>static struct resource omap3_mbox_resources[] = {
>       ...
>};
>#endif
>
>#if defined(CONFIG_ARCH_OMAP4)
>static struct resource omap4_mbox_resources[] = {
>       ...
>};
>#endif
>
>static struct platform_device mbox_device = {
>	.name		= "omap2-mailbox",
>	.id		= -1,
>};
>
>static inline void omap_init_mbox(void)
>{
>#if defined(CONFIG_ARCH_OMAP2)
>	if (cpu_is_omap2420()) {
>		mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources);
>		mbox_device.resource = omap2_mbox_resources;
>	}
>#endif
>#if defined(CONFIG_ARCH_OMAP3)
>	if (cpu_is_omap3430()) {
>		mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources);
>		mbox_device.resource = omap3_mbox_resources;
>	}
>#endif
>#if defined(CONFIG_ARCH_OMAP4)
>	if (cpu_is_omap44xx()) {
>		mbox_device.num_resources = ARRAY_SIZE(omap4_mbox_resources);
>		mbox_device.resource = omap4_mbox_resources;
>	}
>#endif
>	if (!mbox_device.resource) {
>		pr_err("%s: platform not supported\n", __func__);
>		return;
>	}
>	platform_device_register(&mbox_device);
>}

in that case, wouldn't it be better to split that into 
arch/arm/omap1/mbox.c arch/arm/omap2/mbox24xx.c 
arch/arm/omap2/mbox34xx.c arch/arm/omap2/mbox44xx.c ??

that way we don't need ifdefs on the code and we will only compile what 
we really need.

just my 2 cents.

-- 
balbi

  reply	other threads:[~2010-03-29  7:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 19:30 [PATCH] OMAP3: mailbox initialization for all omap versions Guzman Lugo, Fernando
2010-03-29  6:40 ` Hiroshi DOYU
2010-03-29  7:01   ` Felipe Balbi [this message]
2010-03-29  9:08     ` Hiroshi DOYU
2010-04-01  9:52       ` Tony Lindgren
2010-04-01 10:23         ` Hiroshi DOYU
2010-04-01 11:26           ` Hiroshi DOYU
2010-04-01 11:36             ` Felipe Balbi
2010-04-01 12:33             ` Paul Walmsley
2010-04-01 12:50               ` Tony Lindgren
2010-04-01 13:06               ` Hiroshi DOYU

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=20100329070145.GF28825@nokia.com \
    --to=felipe.balbi@nokia.com \
    --cc=ameya.palande@nokia.com \
    --cc=felipe.contreras@nokia.com \
    --cc=hiroshi.doyu@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=x0095840@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