mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Teresa Remmet <t.remmet@phytec.de>
To: Trent Piepho <tpiepho@kymetacorp.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH v2 1/3] common: oftree: Add fuction to register set status fixup
Date: Fri, 26 Feb 2016 08:52:55 +0100	[thread overview]
Message-ID: <1456473175.3401.4.camel@lws-tremmet.phytec.de> (raw)
In-Reply-To: <1456424342.25961.17.camel@rtred1test09.kymeta.local>

Hello Trent,

Am Donnerstag, den 25.02.2016, 18:18 +0000 schrieb Trent Piepho:
> On Thu, 2016-02-25 at 08:36 +0100, Teresa Remmet wrote:
> 
> >  
> > +struct of_fixup_status_data {
> > +	char *node;
> 
> const char *node.
> 
> I think path would be a better name, as node usually is a device_node
> pointer, not a path.

I named it node as it could also be an alias and not only a path.
But I don't might to rename it.

I'll send a fixup, also for the rest.

Regards,
Teresa

> 
> > +	bool status;
> > +};
> > +
> > +static int of_fixup_status(struct device_node *root, void *context)
> > +{
> > +	struct of_fixup_status_data *data = context;
> 
> const struct of_fixup_status_data *data
> 
> > +	struct device_node *node;
> > +
> > +	node = of_find_node_by_path_or_alias(root, data->node);
> > +	if (!node)
> > +		return -ENODEV;
> > +
> > +	if (data->status)
> > +		return of_device_enable(node);
> > +	else
> > +		return of_device_disable(node);
> > +}
> > +
> > +/**
> > + * of_register_set_status_fixup - register fix up to set status of nodes
> > + * Register a fixup to enable or disable a node in the devicet tree by
> > + * passing the path or alias.
> > + */
> > +int of_register_set_status_fixup(char *node, bool status)
> 
> (const char *path, bool status)
> 
> > +{
> > +	struct of_fixup_status_data *data;
> > +
> > +	data = xzalloc(sizeof(*data));
> > +	data->node = node;
> > +	data->status = status;
> > +
> > +	return of_register_fixup(of_fixup_status, (void *)data);
> > +}



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

      reply	other threads:[~2016-02-26  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25  7:36 Teresa Remmet
2016-02-25  7:36 ` [PATCH v2 2/3] commands: Add of_fixup_status Teresa Remmet
2016-02-25  7:36 ` [PATCH v2 3/3] ARM: am335x_defconfig: Enable the of_fixup_status command Teresa Remmet
2016-02-25  8:53 ` [PATCH v2 1/3] common: oftree: Add fuction to register set status fixup Sascha Hauer
2016-02-25 18:18 ` Trent Piepho
2016-02-26  7:52   ` Teresa Remmet [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=1456473175.3401.4.camel@lws-tremmet.phytec.de \
    --to=t.remmet@phytec.de \
    --cc=barebox@lists.infradead.org \
    --cc=tpiepho@kymetacorp.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