Message ID | 20150730095051.06eff8b1@bbrezillon (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jul 30, 2015 at 09:50:51AM +0200, Boris Brezillon wrote: > Since you have to patch your DTs anyway, how about putting your > partitions in a subnode and patch the ofpart code to parse this subnode > if it is present (see the following patch). This is the best idea, yes - if we're changing the DT for the system anyway then making a sane binding and using that seems better than trying to mitigate problems with the old bindings.
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index 8a06cfb..ba52b88 100644 --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c @@ -38,7 +38,10 @@ static int parse_ofpart_partitions(struct mtd_info *master, if (!data) return 0; - node = data->of_node; + node = of_get_child_by_name(data->of_node, "partitions"); + if (!node) + node = data->of_node; + if (!node) return 0;