linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: publishing OF platform devices
Date: Fri, 30 Mar 2007 08:25:41 +1000	[thread overview]
Message-ID: <1175207141.5624.27.camel@localhost.localdomain> (raw)
In-Reply-To: <200703300018.53809.arnd@arndb.de>

On Fri, 2007-03-30 at 00:18 +0200, Arnd Bergmann wrote:
> On Friday 30 March 2007, Benjamin Herrenschmidt wrote:
> > 
> > > The ppc_md->init() function is currently only present on 32 bit,
> > > if we decide that this is the way to go, we should make it common
> > > to both 32 and 64 bit platforms.
> > 
> > I still think we should do something like platform_xxx_initcall(); with
> > xxx being {core,subsys,device,...} ... I'll look into it. ppc_md.init()
> > is a bit gross.
> 
> Yes, that sounds like a good idea, but I'd much prefer adding these only
> if they actually simplify the existing code, rather than having them
> for completeness.

They will at first generate something like:

static int func(void)
{
	if (!machine_is(platform))
		return 0;
	return user_func();
}

xxx_initcall(func);

And thus will be equivalent in generated code to the open coded
versions, but that is already enough to avoid, I hope, quite a bit of
mistakes and simplify the source.

Later on, we can look into doing some smart ELF section tricks to also
reduce the generated code.

> We also might want to have something a lot simpler at first. Since
> many platforms just want to call
> 
> of_platform_bus_probe(NULL, foo_ids, NULL);
> 
> There could simply be an entry in ppc_md that gets set to foo_ids
> and we call of_platform_bus_probe() with that, and get rid of the
> unused root and parent arguments.

Might not be unused forever... oh well, we'll see.

Ben.

      reply	other threads:[~2007-03-29 22:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-29 21:20 publishing OF platform devices John Rigby
2007-03-29 21:26 ` Sylvain Munaut
2007-03-29 21:56   ` Kim Phillips
2007-03-29 21:57   ` Arnd Bergmann
2007-03-29 22:07     ` Benjamin Herrenschmidt
2007-03-29 22:18       ` Arnd Bergmann
2007-03-29 22:25         ` Benjamin Herrenschmidt [this message]

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=1175207141.5624.27.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=arnd@arndb.de \
    --cc=linuxppc-dev@ozlabs.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).