mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Baeuerle, Florian" <Florian.Baeuerle@allegion.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH] commands/of_node: add option to apply changes as fixup
Date: Mon, 28 May 2018 18:10:36 +0200	[thread overview]
Message-ID: <20180528161036.ii4miygb3u6naftn@pengutronix.de> (raw)
In-Reply-To: <58ea01ed8cdfcade129d7d5b5aa5455066572d75.camel@allegion.com>

On Fri, May 25, 2018 at 10:47:54AM +0000, Baeuerle, Florian wrote:
> Am Freitag, den 25.05.2018, 10:41 +0000 schrieb Baeuerle, Florian:
> > Analogous to the of_property command, add an -f option to the of_node
> > command. This option defers the device tree modification until boot
> > time and thus applies the modification as a fixup on the linux device
> > tree.
> > 
> > Signed-off-by: Florian Bäuerle <florian.baeuerle@allegion.com>
> > ---
> >  commands/of_node.c | 106 ++++++++++++++++++++++++++++++++-------------
> >  1 file changed, 75 insertions(+), 31 deletions(-)
> > 
> > diff --git a/commands/of_node.c b/commands/of_node.c
> > index 4962e5242..29cc371dd 100644
> > --- a/commands/of_node.c
> > +++ b/commands/of_node.c
> > @@ -32,16 +32,66 @@
> >  #include <init.h>
> >  #include <libgen.h>
> >  
> > +static int do_of_node_create_now(struct device_node *root, const char *path);
> > +static int do_of_node_delete_now(struct device_node *root, const char *path);
> > +
> > +static int of_fixup_node_create(struct device_node *root, void *context)
> > +{
> > +	return do_of_node_create_now(root, (const char *)context);
> > +}
> > +
> > +static int of_fixup_node_delete(struct device_node *root, void *context)
> > +{
> > +	return do_of_node_delete_now(root, (const char *)context);
> > +}
> > +
> > +static int do_of_node_create_fixup(const char *path)
> > +{
> > +	char *data = xstrdup(path);
> > +
> > +	return of_register_fixup(of_fixup_node_create, (void *)data);
> > +}
> > +
> > +static int do_of_node_delete_fixup(const char *path)
> > +{
> > +	char *data = xstrdup(path);
> > +
> > +	return of_register_fixup(of_fixup_node_delete, (void *)data);
> > +}
> 
> I know the two functions above do not do a lot, but I wanted to keep it similar
> to the of_property implementation.  If you'd like them go away, just tell me.

It's ok. Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

      reply	other threads:[~2018-05-28 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 10:41 Baeuerle, Florian
2018-05-25 10:47 ` Baeuerle, Florian
2018-05-28 16:10   ` Sascha Hauer [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=20180528161036.ii4miygb3u6naftn@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=Florian.Baeuerle@allegion.com \
    --cc=barebox@lists.infradead.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