netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org, netdev@vger.kernel.org,
	jeff@garzik.org, ralf@linux-mips.org, sshtylyov@ru.mvista.com
Subject: Re: [PATCH 2/3] ne: MIPS: Use platform_driver for ne on RBTX49XX
Date: Sat, 28 Apr 2007 01:04:14 -0700	[thread overview]
Message-ID: <20070428010414.2ba43a30.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070425.015549.108742168.anemo@mba.ocn.ne.jp>

On Wed, 25 Apr 2007 01:55:49 +0900 (JST) Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote:

> +static int __init rbtx4938_ne_init(void)
> +{
> +	struct resource res[] = {
> +		{
> +			.start	= RBTX4938_RTL_8019_BASE,
> +			.end	= RBTX4938_RTL_8019_BASE + 0x20 - 1,
> +			.flags	= IORESOURCE_IO,
> +		}, {
> +			.start	= RBTX4938_RTL_8019_IRQ,
> +			.flags	= IORESOURCE_IRQ,
> +		}
> +	};
> +	struct platform_device *dev =
> +		platform_device_register_simple("ne", -1,
> +						res, ARRAY_SIZE(res));
> +	return IS_ERR(dev) ? PTR_ERR(dev) : 0;
> +}

platform_device_register_simple() copies *res by value, so I believe we can
make res[] static __initdata.  This way we don't need to evaluate the array
on the stack at runtime, and the data gets discarded after initcalls have
run.

Can you please review and test the below?  I had a go but wasn't able to
fumble my way to a suitable config (I hope):

<stdin>:1176:2: warning: #warning syscall fadvise64_64 not implemented
arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c: In function `toshiba_rbtx4927_time_init':
arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c:1026: error: `tx4927_cpu_clock' undeclared (first use in this function)
arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c:1026: error: (Each undeclared identifier is reported only once
arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c:1026: error: for each function it appears in.)
make[1]: *** [arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.o] Error 1
make: *** [arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.o] Error 2
make: *** Waiting for unfinished jobs....
arch/mips/tx4938/toshiba_rbtx4938/setup.c:41: warning: 'tx4938_report_pcic_status1' declared `static' but never defined
arch/mips/tx4938/toshiba_rbtx4938/setup.c:56: warning: 'tx4938_pcic_trdyto' defined but not used
arch/mips/tx4938/toshiba_rbtx4938/setup.c:57: warning: 'tx4938_pcic_retryto' defined but not used



From: Andrew Morton <akpm@linux-foundation.org>

Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c~ne-mips-use-platform_driver-for-ne-on-rbtx49xx-fix arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c~ne-mips-use-platform_driver-for-ne-on-rbtx49xx-fix
+++ a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
@@ -1039,7 +1039,7 @@ void __init toshiba_rbtx4927_timer_setup
 
 static int __init toshiba_rbtx4927_rtc_init(void)
 {
-	struct resource res = {
+	static struct resource __initdata res = {
 		.start	= 0x1c010000,
 		.end	= 0x1c010000 + 0x800 - 1,
 		.flags	= IORESOURCE_MEM,
@@ -1052,7 +1052,7 @@ device_initcall(toshiba_rbtx4927_rtc_ini
 
 static int __init rbtx4927_ne_init(void)
 {
-	struct resource res[] = {
+	static struct resource __initdata res[] = {
 		{
 			.start	= RBTX4927_RTL_8019_BASE,
 			.end	= RBTX4927_RTL_8019_BASE + 0x20 - 1,
_

  parent reply	other threads:[~2007-04-28  8:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-24 16:55 [PATCH 2/3] ne: MIPS: Use platform_driver for ne on RBTX49XX Atsushi Nemoto
2007-04-24 17:03 ` Atsushi Nemoto
2007-04-28 15:08   ` Jeff Garzik
2007-04-28  8:04 ` Andrew Morton [this message]
2007-04-28 17:10   ` Atsushi Nemoto
2007-04-30 15:14     ` Atsushi Nemoto
2007-04-28 15:10 ` Jeff Garzik
2007-04-28 17:24   ` Atsushi Nemoto
2007-04-28 17:28     ` Jeff Garzik

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=20070428010414.2ba43a30.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=jeff@garzik.org \
    --cc=linux-mips@linux-mips.org \
    --cc=netdev@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    --cc=sshtylyov@ru.mvista.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;
as well as URLs for NNTP newsgroup(s).