mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/4] sandbox: only access of_add_memory_bank if it's defined
Date: Fri, 27 Jun 2014 09:28:42 +0200	[thread overview]
Message-ID: <20140627072840.GB30849@omega> (raw)
In-Reply-To: <20140626204232.GL14257@pengutronix.de>

On Thu, Jun 26, 2014 at 10:42:32PM +0200, Sascha Hauer wrote:
> On Thu, Jun 26, 2014 at 10:49:15AM +0200, Holger Schurig wrote:
> > ... and it's defined only when CONFIG_OFTREE_MEM_GENERIC is on.
> > 
> > Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
> > ---
> >  drivers/of/base.c |    6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/of/base.c b/drivers/of/base.c
> > index c440a69..818d76e 100644
> > --- a/drivers/of/base.c
> > +++ b/drivers/of/base.c
> > @@ -1697,6 +1697,7 @@ int of_set_property(struct device_node *np, const char *name, const void *val, i
> >  	return 0;
> >  }
> >  
> > +#ifdef CONFIG_OFTREE_MEM_GENERIC
> >  int of_add_memory(struct device_node *node, bool dump)
> >  {
> >  	const char *device_type;
> > @@ -1720,6 +1721,7 @@ int of_add_memory(struct device_node *node, bool dump)
> >  
> >  	return 0;
> >  }
> > +#endif
> 
> This will break MIPS support. MIPS has it's own implementation of
> of_add_memory_bank (see ./arch/mips/boot/dtb.c), so in MIPS case
> the Kconfig options means "I have my own version of of_add_memory_bank"
> 

Then maybe, move this implementation to "drivers/of/mem_generic.c". This
function doesn't use any static function of this file (What I see,
currently).

Then make a own header with dummy implementation:

#ifdef CONFIG_OFTREE_MEM_GENERIC
int of_add_memory(struct device_node *node, bool dump)
{
...
}
#else 
int of_add_memory(struct device_node *node, bool dump)
{
	return -EOPNOTSUPP;
}
#endif

The file drivers/of/mem_generic.c depends on PPC || ARM, so let
the buildsystem do the rest.

- Alex

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2014-06-27  7:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26  8:49 Holger Schurig
2014-06-26  9:37 ` Alexander Aring
2014-06-26  9:39   ` Alexander Aring
2014-06-26  9:43   ` Holger Schurig
2014-06-26  9:48     ` Alexander Aring
2014-06-26  9:43   ` Alexander Aring
2014-06-26 20:42 ` Sascha Hauer
2014-06-27  7:28   ` Alexander Aring [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=20140627072840.GB30849@omega \
    --to=alex.aring@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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