mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@kymetacorp.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH v2 1/8] of_path: of_find_path() factor out device detection logic into separate function
Date: Thu, 10 Dec 2015 22:38:35 +0000	[thread overview]
Message-ID: <1449787121.26955.89.camel@rtred1test09.kymeta.local> (raw)
In-Reply-To: <1445330352-30153-2-git-send-email-mkl@pengutronix.de>

On Tue, 2015-10-20 at 10:39 +0200, Marc Kleine-Budde wrote:
> This patch factors out the device detection logic into separate function, so
> that it can be used from another function.

The use of device-path = &mmc0, "partname:0"; breaks because it tries to
get the "partname:0" string by looking at "device-path" in &mmc0.  It
should be looking for device-path in the original node.
 
> +int __of_find_path(struct device_node *node, const char *propname, char **outpath, unsigned flags)
> +{

> +	while (propname) {
> +		ret = of_property_read_string_index(node, propname, i++, &str);

Here 'node' is the device node pointed to by propname in the node
originally passed to of_find_path().  I.e., &mmc0.


>  int of_find_path(struct device_node *node, const char *propname, char **outpath, unsigned flags)
>  {
> -
> -	while (1) {
> -		ret = of_property_read_string_index(node, propname, i++, &str);
> -		if (ret)

But here 'node' is the node that is passed to of_find_path.

> +	return __of_find_path(rnode, propname, outpath, flags);

Because here you pass rnode, not node, to __of_find_path() and then use
it where the original code used node.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-12-10 22:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20  8:39 [PATCH v2 1/8] state framework enhancements Marc Kleine-Budde
2015-10-20  8:39 ` [PATCH v2 1/8] of_path: of_find_path() factor out device detection logic into separate function Marc Kleine-Budde
2015-10-21  6:24   ` Sascha Hauer
2015-12-10 22:38   ` Trent Piepho [this message]
2015-12-11  0:07     ` [PATCH] of_path: Fix bug with partitions, simply code Trent Piepho
2015-12-11  9:35       ` Sascha Hauer
2015-12-11 18:51         ` Trent Piepho
2015-12-16 10:43       ` Sascha Hauer
2015-10-20  8:39 ` [PATCH v2 2/8] of_path: add of_find_path_by_phandle() Marc Kleine-Budde
2015-10-20  8:39 ` [PATCH v2 3/8] state: make use of of_find_path_by_phandle() and add return -EPROBE_DEFER if device is not available Marc Kleine-Budde
2015-10-20  8:39 ` [PATCH v2 4/8] state: use name of device node as name if alias " Marc Kleine-Budde
2015-10-20  8:39 ` [PATCH v2 5/8] state: disable load command Marc Kleine-Budde
2015-10-20  8:39 ` [PATCH v2 6/8] crypto: add simple keystore Marc Kleine-Budde
2015-10-20  8:39 ` [PATCH v2 7/8] state: prepare raw backend for hmac support Marc Kleine-Budde
2015-10-20  8:39 ` [PATCH v2 8/8] state: backend_raw: add hamc support Marc Kleine-Budde
2015-10-20  9:49   ` Jan Lübbe
2015-10-21  7:13   ` Sascha Hauer
2015-10-21  8:56     ` Marc Kleine-Budde
2015-10-21  9:12       ` Sascha Hauer

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=1449787121.26955.89.camel@rtred1test09.kymeta.local \
    --to=tpiepho@kymetacorp.com \
    --cc=barebox@lists.infradead.org \
    --cc=mkl@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