mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/2] of: mtd: partition: Use reproducible node names for fixup
Date: Fri, 26 Jan 2018 20:26:44 +0100	[thread overview]
Message-ID: <20180126192644.5434-3-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20180126192644.5434-1-s.hauer@pengutronix.de>

The full names of device nodes are not as stable as we like them
to be. Lately the leading zeroes in the i.MX6 device trees were
removed which led to the result that we can no longer find the
partition nodes in the to be fixed tree. Use reproducible names
to overcome this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/of/partition.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/of/partition.c b/drivers/of/partition.c
index ac20490231..6f9651a9e4 100644
--- a/drivers/of/partition.c
+++ b/drivers/of/partition.c
@@ -130,6 +130,7 @@ static int of_partition_fixup(struct device_node *root, void *ctx)
 {
 	struct cdev *cdev = ctx, *partcdev;
 	struct device_node *np, *part, *partnode;
+	char *name;
 	int ret;
 	int n_cells, n_parts = 0;
 
@@ -153,7 +154,9 @@ static int of_partition_fixup(struct device_node *root, void *ctx)
 	else
 		n_cells = 1;
 
-	np = of_find_node_by_path_from(root, cdev->device_node->full_name);
+	name = of_get_reproducible_name(cdev->device_node);
+	np = of_find_node_by_reproducible_name(root, name);
+	free(name);
 	if (!np) {
 		dev_err(cdev->dev, "Cannot find nodepath %s, cannot fixup\n",
 				cdev->device_node->full_name);
-- 
2.15.1


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

  parent reply	other threads:[~2018-01-26 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26 19:26 [PATCH 0/2] Make finding fixup nodes more robust Sascha Hauer
2018-01-26 19:26 ` [PATCH 1/2] of: Add function to find the same node in another tree Sascha Hauer
2018-01-26 19:26 ` Sascha Hauer [this message]
2018-01-26 20:46 ` [PATCH 0/2] Make finding fixup nodes more robust Sam Ravnborg
2018-01-26 21:36   ` 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=20180126192644.5434-3-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --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