From patchwork Tue Sep 25 14:40:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 147466 Delivered-To: patches@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp812361lji; Tue, 25 Sep 2018 07:40:32 -0700 (PDT) X-Received: by 2002:ac2:4218:: with SMTP id y24-v6mr1085292lfh.6.1537886432882; Tue, 25 Sep 2018 07:40:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537886432; cv=none; d=google.com; s=arc-20160816; b=VMmlYSW9mRiniLjbv64kPS0+aEOh60N7hb7PpmvFrB8sXmO9U/wEBepiw438yyAyFz iq+iHi9fwDOYOBCuyubbYYhHNz4sn5wYzDheqAYL8P5tIrD1h90QjOz6Qr43IjfzRdAa K9CiRdwvbNAQGajdQxaWFSL4RzGPfJPJmzBST7Ttf1nvPHnnJKQuqYvXKPBrqRFN2T9d 71B68nrNpTc+RY1zj8NYmxoXZddwPnNX/JslXfJgYiVPRIEMW7Ael2lErKd8zhxSjZoR OTAs0pxBLKcZLkfHMgr4uvvU4yWZHU6eK25X+2QgCa/YdUrzvStC1y702Y83w9WoppGc fzaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iQSx05HMMUi4xwXlVR+Lc/rZdgi5IRf7YE6TG4glvE8=; b=ZsxzMVMuD5GLJXZykFNGGvaKdFJVsgts6djAyVBwtGkBSoe9W6VpGM+IROo/jugCVb CB8ibwJsMpn1GzPrYgLFnf0XrhBjGGNnYN/6MerVMtc4ADEm+CfufXwgEamv3MTd+AIZ xx5788iYtDydO8unSe8wVK3qGsc/TColqXmFi2Be21uXYM6ROSwe0itCr9sz3qq6U52B NT9mLeO7XdbvzdayEUvGyanL2ENCor6s9TFJq0t5iB2zYztZxiBfZp5Yjqg/vFMjWBeX yBvQm7FfwUJ6Wt+mKkA5RXpMNifhRexZkMsKeO4gSvOvD8p4bS82BaveSkVLz8T+mM0n Wq2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fy7/azAf"; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id n4-v6sor1182732ljj.20.2018.09.25.07.40.32 for (Google Transport Security); Tue, 25 Sep 2018 07:40:32 -0700 (PDT) Received-SPF: pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fy7/azAf"; spf=pass (google.com: domain of jens.wiklander@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=jens.wiklander@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iQSx05HMMUi4xwXlVR+Lc/rZdgi5IRf7YE6TG4glvE8=; b=fy7/azAfkVvzp3lD11Kx3zHq4762sywCkNjsWElfvx3TxiWjLGv/42FUqpVcvvC6t5 WI7rTzn6/qgtDXggF3+ReAvHntgNqYYm1c29DafWBWdz0yzsirVySqMNZk+lT6KOPJIg yRJ8rfZYN3yQGP/zD65O3Wv3Rb+ktX4p1R07U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iQSx05HMMUi4xwXlVR+Lc/rZdgi5IRf7YE6TG4glvE8=; b=P4qwTPVR5ZOUp75TQIhc7wG5f+1FSnZ9+5ka/naWb7C6lKRq9x0MsP0G+AsTOnWXhy IMj+O8hE4zDYY9IgbAGDdNn11IldPjYGE/UIFQNjhXhCLiJKGl4dQn5Hu293h/0SftEL +dvWoZ7W0GP33NYNigPRPYDY6FZhK6Gwq07UQikGyEP4WNk6Bh6rJgDuzDs9YQnHn+f4 N1r2yGViXldp1KvY/Dflmng/M4Y19NE4tMz5Nb+20UfX6F50XgU7G1jM6sfZLDEe1ki8 1Min08iqH0+efZhFK+GKIdewlgZz0gzL0Lgjcgr6B6N1abHuhWxTq4f/g3aKBb7sEfQq fEFQ== X-Gm-Message-State: ABuFfoj5o6wO0IQuW7UNOTWy02w+4S66jjB8A/xzcE1jq4vljZclbKTo vDSDaB9cJJIyFLiA0bUv3aamHXqL X-Google-Smtp-Source: ACcGV63Qj7b1VqFEFjJ+hzGPwwOtJPJffls4LVsRK6Naqgp9yAIefhhh8nvekVElBzFcRWS6Yzbd6Q== X-Received: by 2002:a2e:1291:: with SMTP id 17-v6mr1267458ljs.74.1537886432573; Tue, 25 Sep 2018 07:40:32 -0700 (PDT) Return-Path: Received: from jax.urgonet (h-84-105.A175.priv.bahnhof.se. [79.136.84.105]) by smtp.gmail.com with ESMTPSA id g14-v6sm14483lja.96.2018.09.25.07.40.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Sep 2018 07:40:31 -0700 (PDT) From: Jens Wiklander To: u-boot@lists.denx.de Cc: Simon Glass , Igor Opaniuk , Tom Rini , Jaehoon Chung , Pierre Aubert , Albert Aribaud , Peter Griffin , Michal Simek , Jens Wiklander Subject: [PATCH v4 01/19] dm: fdt: scan for devices under /firmware too Date: Tue, 25 Sep 2018 16:40:05 +0200 Message-Id: <20180925144023.24555-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925144023.24555-1-jens.wiklander@linaro.org> References: <20180925144023.24555-1-jens.wiklander@linaro.org> Just as /chosen may contain devices /firmware may contain devices, scan for devices under /firmware too. Reviewed-by: Simon Glass Signed-off-by: Jens Wiklander --- drivers/core/root.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/core/root.c b/drivers/core/root.c index 72bcc7d7f2a3..0dca507e1187 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -265,9 +265,15 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob, for (offset = fdt_first_subnode(blob, offset); offset > 0; offset = fdt_next_subnode(blob, offset)) { - /* "chosen" node isn't a device itself but may contain some: */ - if (!strcmp(fdt_get_name(blob, offset, NULL), "chosen")) { - pr_debug("parsing subnodes of \"chosen\"\n"); + const char *node_name = fdt_get_name(blob, offset, NULL); + + /* + * The "chosen" and "firmware" nodes aren't devices + * themselves but may contain some: + */ + if (!strcmp(node_name, "chosen") || + !strcmp(node_name, "firmware")) { + pr_debug("parsing subnodes of \"%s\"\n", node_name); err = dm_scan_fdt_node(parent, blob, offset, pre_reloc_only); @@ -286,8 +292,7 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob, err = lists_bind_fdt(parent, offset_to_ofnode(offset), NULL); if (err && !ret) { ret = err; - debug("%s: ret=%d\n", fdt_get_name(blob, offset, NULL), - ret); + debug("%s: ret=%d\n", node_name, ret); } }