Message ID | 20240130004508.1700335-7-sboyd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-43690-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp920767dyb; Mon, 29 Jan 2024 16:47:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHS8TR4YdMTFS4PdjfB3EErYyKTXJkIGdDlZZKaFecYXA0T7Q+VqoSD3vraTW1vjhrm2Gvr X-Received: by 2002:a17:906:d146:b0:a30:f558:e04f with SMTP id br6-20020a170906d14600b00a30f558e04fmr5680089ejb.7.1706575645498; Mon, 29 Jan 2024 16:47:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706575645; cv=pass; d=google.com; s=arc-20160816; b=sxhS3kx6ApCt16peCscDlJqfODhJHioaShdbRVlrksYuEeFXibn5gCX4aITBinhGuO sHBfCbB7cUOx1lNuRpDJoafWmIjDq/end23rfEmX2ipypIBH9F0GASz5zUhz12uvchOt BMX3KfyQwQEFlY1leAjBWGTfFtHilVG1YEijhzbJ07RrTrmHVSnAkYf21ow7NESNjXV3 oHl09bcufXx7Rt3RT5J69CLWY6zIWGPp8933lNT4ihCNI8lSUP8VJVdnyib7W6s5sRAQ 5hEpQERqeEZXtuwYahJl+XT9vbr5ILqADTB8MFZPyXALJw/9bGaRokqnG/UBeRoL7zvi bMgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Vxm7GroJb1jr7a7SKxct7zVVLJ9MIYxfQSDNcHJxJs8=; fh=R/gIXN/nmdWOBYt8u4a8BOYYdlFigy1MtQckky2cQ+g=; b=b3C1BYnL+oDM08coYyEPaZl4NmRQNRRp2Z4GYicidlmd0+/Y4MTNhNflR/ia8A9MGF np6vrzXVAovUfwHHW8SNMwCdN3RcGKMxNV0PDCDeUnbGPj4SZ0LoLzH9T1LjEwlcJrB3 iWzJMcNUVtOaN2LSYkGTWFdL9fcg9tMApcPa7dOs1gJEcYvX+Q0qJqYmR8H9kZaFbzFO fePRf658GgUPQXhP9p1y+EdhvUHZLxwULR/ly3DMX1ndwY2YExOwL3O6m+pxSgtoIN3g TeW9Fodo5Jury54whJz2+dJiVAnSFNcKgN8IF9vN+hYBV70Ypfw5iaZSG5cG0fc4lkhN mk5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oAvRw3fA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-43690-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43690-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id si3-20020a170906cec300b00a316c9abcb6si4059195ejb.483.2024.01.29.16.47.25 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 16:47:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43690-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oAvRw3fA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-43690-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43690-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 216911F23E01 for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 00:47:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95FED37716; Tue, 30 Jan 2024 00:45:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oAvRw3fA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D91CE36B02; Tue, 30 Jan 2024 00:45:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706575515; cv=none; b=CmdTnOzxV4UL9ifg2zEv6f92Nn554VgpRdi9ZlhPugrGca61PaRoit63GPHHHP6UnqrchI+hc5YwdlTZOLHNFLydxcyqqX3OlHCjFdgRmzArWx5ya5lDSAUcYLJvs3vB/9RC55Hsfn0q8RDbnbMXs9y5xBoJfwQ4XEtWlyBcYbA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706575515; c=relaxed/simple; bh=QNmBS0brQeJSjUserQhzHk2Vt2IzcbhX82b9CN/v9CM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=emrrLAf/68NPd7ZuNnZCeNsWAVZcKU56fWYqXCutdKLNZ3tDHzSbTKRTTvkutd5EPhbPb9PanyKJ9+LLWbckQxX4UjFMu5xh7PXnmIacZV+ydkzVEAGvL/Oog9Wuw2oUzF/IeZdw8PFHJZzzP/rz6Cmk5vo/Q1SThHfZ0ZeHH5s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oAvRw3fA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C548C43399; Tue, 30 Jan 2024 00:45:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706575514; bh=QNmBS0brQeJSjUserQhzHk2Vt2IzcbhX82b9CN/v9CM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oAvRw3fAoNWjiVmINtzMu5LYHOPzthZ41RXtSehMcsOa5hH/n47mQJbwPX2YmtRQH bzWW1cBevhWm3guAvl0N4bT/8Is877dtInpWAtotrWqzYO0DdFYikRUBbXY+71z0iT /pv5C9PH8rC3AmSPrzXXEB7xIE4NlYtlu0suj1aSB3RA3o39qzMCUBpl27IdEdtupr jVCILCD5y8v/gEjL2xzgqAcFMBCJySfXA1Gwxafe26t3L/H+BORWJN4ONXYV3gI5gH CVpyf+GvJfjjAqShbWztM2Npaan26dTC/XaAATjqVlON4splpFImESEFk1h1AOMSWI +kqrvevHV7aEg== From: Stephen Boyd <sboyd@kernel.org> To: Rob Herring <robh+dt@kernel.org> Cc: Frank Rowand <frowand.list@gmail.com>, linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-um@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 6/7] of: unittest: treat missing of_root as error instead of fixing up Date: Mon, 29 Jan 2024 16:45:05 -0800 Message-ID: <20240130004508.1700335-7-sboyd@kernel.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240130004508.1700335-1-sboyd@kernel.org> References: <20240130004508.1700335-1-sboyd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789474264056709847 X-GMAIL-MSGID: 1789474264056709847 |
Series |
of: populate of_root node if bootloader doesn't
|
|
Commit Message
Stephen Boyd
Jan. 30, 2024, 12:45 a.m. UTC
From: Frank Rowand <frowand.list@gmail.com> unflatten_device_tree() now ensures that the 'of_root' node is populated with the root of a default empty devicetree. Remove the unittest code that created 'of_root' if it was missing. Verify that 'of_root' is valid before attempting to attach the testcase-data subtree. Remove the unittest code that unflattens the unittest overlay base if architecture is UML because that is always done now. Signed-off-by: Frank Rowand <frowand.list@gmail.com> Link: https://lore.kernel.org/r/20230317053415.2254616-3-frowand.list@gmail.com Cc: Rob Herring <robh+dt@kernel.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org> --- drivers/of/unittest.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index a8b27dd16ecf..742d919e8ab4 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -1732,20 +1732,16 @@ static int __init unittest_data_add(void) return -EINVAL; } + /* attach the sub-tree to live tree */ if (!of_root) { - of_root = unittest_data_node; - for_each_of_allnodes(np) - __of_attach_node_sysfs(np); - of_aliases = of_find_node_by_path("/aliases"); - of_chosen = of_find_node_by_path("/chosen"); - of_overlay_mutex_unlock(); - return 0; + pr_warn("%s: no live tree to attach sub-tree\n", __func__); + kfree(unittest_data); + return -ENODEV; } EXPECT_BEGIN(KERN_INFO, "Duplicate name in testcase-data, renamed to \"duplicate-name#1\""); - /* attach the sub-tree to live tree */ np = unittest_data_node->child; while (np) { struct device_node *next = np->sibling;