From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hZ9MM-0005gq-K7 for barebox@lists.infradead.org; Fri, 07 Jun 2019 07:32:24 +0000 From: Oleksij Rempel Date: Fri, 7 Jun 2019 09:32:09 +0200 Message-Id: <20190607073210.13915-3-linux@rempel-privat.de> In-Reply-To: <20190607073210.13915-1-linux@rempel-privat.de> References: <20190607073210.13915-1-linux@rempel-privat.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v2 3/4] of: base: don't try to read cells_name property if no cells_name set To: barebox@lists.infradead.org Cc: Oleksij Rempel Some device tree node parsed by of_count_phandle_with_args() have no #*-cells parameter. To make linux device trees work with barebox, we should accept cells_name set to NULL, so sync this behavior with linux. Signed-off-by: Oleksij Rempel --- drivers/of/base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 838f530f8..d72c687ef 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1360,7 +1360,8 @@ static int __of_parse_phandle_with_args(const struct device_node *np, np->full_name); goto err; } - if (of_property_read_u32(node, cells_name, &count)) { + if (cells_name && + of_property_read_u32(node, cells_name, &count)) { pr_err("%s: could not get %s for %s\n", np->full_name, cells_name, node->full_name); -- 2.20.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox