From patchwork Fri Jul 17 01:46:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 235665 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1291193ilg; Thu, 16 Jul 2020 18:47:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMG4dglJW5dLdtoAISOH4WPEuDkgOeDbPxNgvJAHSmx1UfbHUTEnrv++MXAppw13vWYBtX X-Received: by 2002:a17:906:fa92:: with SMTP id lt18mr6371665ejb.534.1594950433365; Thu, 16 Jul 2020 18:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594950433; cv=none; d=google.com; s=arc-20160816; b=ts1ANYbokC8uI3eVqPBSHr085wIE0ezU19QcMCZmg+EFTjvWtf+L3gouUWUTUA+9fl dx1vuEeDMVeu9whYc9GVV+XmZPEXm0vxd2R6mq8FB7NkXEdgMvjKSQ3kqsPje1VYQEJn QlrbFhQ5BuEZyZquQtc7ERuBmuDA0bPaFT16AD8tX9kBTPggtCVJ72XJ+svhaK+H7l0T GGqcKCcQlEn5KHwppEyeJhW3n42r9aDkh5vie1IvIn/7FIa9SivG/Wo5f09XiptVNbgz RXeH/EZ3IGmks2+lyiT3oN0JSIj8hbG3gXHJGJbABx++d2b9QHMTXlfrFEXL7mi0KuJc Za5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=NpnNNlgJSpr2aW/KEhyy9Y7WVbdTXFKkHy02TOlqaI4=; b=fRMhx+hkp0JsSh1xUozClaCByN3y1xDKDbxL3/bjVXGSvRk147lzlDoAiochyYkXDk eExIWHnFcTT4gVahg0ILB9EzblIdkP+K+N9rlPg0hPfa++zXpohuodhqMxFPCyc2sNt3 1Vsz8vzUu80rsf73b5s5Fg3brRZ3WnEkSSKl1SPJjzeFhyOVPxTnvuq+qqVfKGmb5ANt mTcR77qb4N0ShRstY6QGskPdPVQTiLmDJel7mDCsAfhizerzItOWJnqMr9TF4FxD7tGw 9pjIBbVOmoTVQ2795DtCsjDuC0Ay4a55NbbiR9p6b3iXt+YJlbKS/D3uKWJzwsgDSis9 5OYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=joa0p7hK; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id j31si4249910edc.371.2020.07.16.18.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 18:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=joa0p7hK; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13C9081C02; Fri, 17 Jul 2020 03:47:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="joa0p7hK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D9FAA81BF9; Fri, 17 Jul 2020 03:46:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8959681BF7 for ; Fri, 17 Jul 2020 03:46:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=yamada.masahiro@socionext.com Received: from oscar.flets-west.jp (softbank126025067101.bbtec.net [126.25.67.101]) (authenticated) by conuserg-08.nifty.com with ESMTP id 06H1kPAo008623; Fri, 17 Jul 2020 10:46:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com 06H1kPAo008623 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1594950386; bh=NpnNNlgJSpr2aW/KEhyy9Y7WVbdTXFKkHy02TOlqaI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=joa0p7hKSP5Nyx4Aymx2oaRoPBS6xUzNiHxxKcvfeeF+LWNX7sbjwpmXz+95NhSb0 AtP1g9fhSDdoOuZTdUQ6ZEXrmA8UomAAVZDwzAmCvy0inQ+poB5gGIhFQPcQZCRciJ vZUuyOc5mgBShYH5tESQzTk1Z7W0ZW0U7yMnyDeWgDAzgrClxdY9OqvMnEKh/BLKwm APSNSZaRqOkfYPv2599XqubpCnMGKImHJpBgIoBX+qyKuw+IervjKMmKMxs1nHUopy vaDgs/NUpO8ibVnmYX75nGfyJNKW35DCCX1/wjOCbNDIdp12YIAMcqWjTS7MTm6ibz prXHAWjO4H7dw== X-Nifty-SrcIP: [126.25.67.101] From: Masahiro Yamada To: u-boot@lists.denx.de Cc: Masahiro Yamada , Simon Glass Subject: [PATCH v2 2/2] fdt_support: skip MTD node with "disabled" in fdt_fixup_mtdparts() Date: Fri, 17 Jul 2020 10:46:19 +0900 Message-Id: <20200717014619.756044-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200717014619.756044-1-yamada.masahiro@socionext.com> References: <20200717014619.756044-1-yamada.masahiro@socionext.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Currently, fdt_fixup_mtdparts() only checks the compatible property. It is pointless to fix up the disabled node. Skip the node if it has the property: status = "disabled" Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- (no changes since v1) common/fdt_support.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/common/fdt_support.c b/common/fdt_support.c index cf09c3c5fb..1ddcc53556 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -955,9 +955,16 @@ void fdt_fixup_mtdparts(void *blob, const struct node_info *node_info, for (i = 0; i < node_info_size; i++) { idx = 0; - noff = fdt_node_offset_by_compatible(blob, -1, - node_info[i].compat); - while (noff != -FDT_ERR_NOTFOUND) { + noff = -1; + + while ((noff = fdt_node_offset_by_compatible(blob, noff, + node_info[i].compat)) >= 0) { + const char *prop; + + prop = fdt_getprop(blob, noff, "status", NULL); + if (prop && !strcmp(prop, "disabled")) + continue; + debug("%s: %s, mtd dev type %d\n", fdt_get_name(blob, noff, 0), node_info[i].compat, node_info[i].type); @@ -973,10 +980,6 @@ void fdt_fixup_mtdparts(void *blob, const struct node_info *node_info, if (fdt_node_set_part_info(blob, noff, dev)) return; /* return on error */ } - - /* Jump to next flash node */ - noff = fdt_node_offset_by_compatible(blob, noff, - node_info[i].compat); } } }