From patchwork Mon Aug 13 15:53:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 144024 Delivered-To: patches@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3246917ljj; Mon, 13 Aug 2018 08:54:06 -0700 (PDT) X-Received: by 2002:a19:385a:: with SMTP id d26-v6mr11136623lfj.47.1534175646382; Mon, 13 Aug 2018 08:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534175646; cv=none; d=google.com; s=arc-20160816; b=pdiD12JDx41vdmiF276fTmSHMGaNX6c8Z+5iI9/eEcFtmnfzN7ezouWk+6Ky7meNQ7 O0Uq1rWPwtvCoAIHdNapY6FTfiYQW2Y+ZDIvgQw2+xgFIxwjTnxcq+vXwPtYDOWQyXsO wOBnOT7SjU+mTbNfn1XdOaBGUXO+ns0zLoV8JFiqq2LpM8t/UpPnDfXSLGNUPMpLcgDQ 4AcA9drSFjzb868ZFI55aZLEcY4/mAdLbOyBER1gTWIWWR9vafJgHCt2GvIFIk4LzP9j 7CB7Hx/lmx5QgN2AlbguQH5g/Dl5aAdWujqJvTOYrZfaZoSCxGkNIvcacd/8A6OavmOD 62yQ== 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:arc-authentication-results; bh=j+kvqfSyg1CJWcHDhfVVXVXwi2uXT6XpteOIAJqhq6A=; b=Z4fMqR1zXUaOAvgpt0oZXTRWt0sBjaJ1vwKM1xvuCiFp/lRnD/hF/avOd4DOjdISaH CHp5zqXrCuHDBxh1F5zx+ZBlZqnF9v/Ef4NBpaBokorsP54he6FGUheXgbae1KJUXTGB abDNKS61aJQo6Hi4++1PRVKdOJBuoYsewI9SVcj0sF9OcvQ3B7uNs4EOhvT00SfUf3tj elKxk+pZ65YbgE3Hh0RrE0/LfAIZ5nu/XQ+NbH+J9j8J5ovhHSITNvyxTRUZHuhBrs04 vlsYgZ4SQ70L9ZTgvFQjDeWgyk4Y9q53+ElbmqEYr0Zrat2SBeEnRyyBGTTJJtWh1ciA EHdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F/turxLw"; 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 r27-v6sor3461508ljb.21.2018.08.13.08.54.06 for (Google Transport Security); Mon, 13 Aug 2018 08:54:06 -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="F/turxLw"; 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=j+kvqfSyg1CJWcHDhfVVXVXwi2uXT6XpteOIAJqhq6A=; b=F/turxLw2FVjtdmRA6U1mj+/KksHB/ta/BuKnQu6sbMHf8Vkc9IDDbCeVSAL8NbHLC J3q4uesHMtVQuwgsoQGvb5JP/7Qa2nl5EaXZ7fK6maQV0FUsodRzVWi+HnY+B4Tz/mOU F6DzjwFJfQhM/E9Z9If6dGvAUQLjpAyqfkUH4= 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=j+kvqfSyg1CJWcHDhfVVXVXwi2uXT6XpteOIAJqhq6A=; b=FkMlTOw/pNFnJeXCrFl+Q5RIOvta4K5VBgKjztpfCqVUJsQZ4XibrjL0F4FP5ss6aO 17YOHu8rsEpjdgpW/rzx6H+6GuUEexLz0yfJJdALrBQSMcR8NVvPbOVvjBrlbEeYnmKw tPL9JWo0oOX5YOMzUGr5mub/mqKIqCPqMew4Yi7IXZP4B7AoLf2j4sO2gHs2ZX9DcilE pUUPWZLcB0d2kyJQ2Z0YJ69JBFjzor+Ol8QXdnfE71sUmwlp6k8aC3LJIe8KYj7tijSb ynmskKlTs6vawchN6mjPmKJ0RDlduOImfRj/vlTaHIRZsFM5PdvSz2EethKgIqLubRx0 WEhQ== X-Gm-Message-State: AOUpUlFNJSfYbU1mTBXwYXLHogZxYVDxmZEYgZTldLQ72mWszZ148jcz y/mCJISd0xia7UHHNLVxRWDiCQmv X-Google-Smtp-Source: AA+uWPx2OIxTBEK8653Kf9cx1MTBVQUu6xnIjLdgUyWZrE0I4SVptNEXeOK5dDn539cZNaOh6kfkHA== X-Received: by 2002:a2e:6505:: with SMTP id z5-v6mr11951305ljb.62.1534175646143; Mon, 13 Aug 2018 08:54:06 -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 q12-v6sm2791624lfc.26.2018.08.13.08.54.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 08:54:05 -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 01/10] dm: fdt: scan for devices under /firmware too Date: Mon, 13 Aug 2018 17:53:38 +0200 Message-Id: <20180813155347.13844-2-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180813155347.13844-1-jens.wiklander@linaro.org> References: <20180813155347.13844-1-jens.wiklander@linaro.org> Just as /chosen may contain devices /firmware may contain devices, scan for devices under /firmware too. 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); } }