Message ID | 20240217010557.2381548-7-sboyd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-69631-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp87470dyc; Fri, 16 Feb 2024 17:10:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU3Tyo3lONF+jA17vHN7CSS/QzoAVFOeCUbwCQY86PKDuxOil4m1WBM55HmqUYmjFVWVzAltHhyn0xPPLaFRWFqUKjGWQ== X-Google-Smtp-Source: AGHT+IHgD8QEiBlLTBxvy4nW/zQjyA1otTNMfJt67lGAGJFu+GtuNX+jowLj5ZSTzhkvFvvso9/r X-Received: by 2002:a05:6358:56a8:b0:17a:f91c:8269 with SMTP id o40-20020a05635856a800b0017af91c8269mr7180605rwf.1.1708132252190; Fri, 16 Feb 2024 17:10:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708132252; cv=pass; d=google.com; s=arc-20160816; b=F3wy8CgxYX/0rN34wtvyszXR27I4c7AT38+50V8MrAYv0zqgYU2ewoo8eFUUsLlS2h HPpeZ/bInVmQ8o/DuoN90OdNKENawfqBo9OyQM17gRfnjyNoeUcD+ZDr91n3Kv6E8OyB ZaSWxttV0vcZ+US0GGr/7ey4Ono5J8MgZOR2wD4YjFB8P2UhzUbehn9wKCf+rkiH6HZC PUmBYJYmc1lV84gKeiSoS9+keyyeMq+CQYnylkHlKunyDOLYd7ifmX4U+QisJ/DmL6bW ZXYNgf9GSzdJWxep8h1u0U97kynOuh4hgASISKlc3y7nz2+LxjpPK5hyJNZArPZ9q77O vmUw== 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=ltXg5dLqXeEAw0B9ekuGlp0meqmOfPS4K+bnj0EGYEw=; fh=R/gIXN/nmdWOBYt8u4a8BOYYdlFigy1MtQckky2cQ+g=; b=ElKO8nPbfNoxw4lKRe6B3p37wuScc7iQKgeyE7nMLwz6jJ5IpzNFm965dzKf6IPOkK APRhwB1ejD+0DkHA9j6EpW3CwVJxs32b3swn7+CceS9DCYY0VvdYoIitOsC8kCKzErAQ 1TJVjbRqFD6qX/El9nGrhpCs0TvWVj8Wc2zYx6d9Ja2JUmgsxEJtv3OntYmR7lsHfK4q OszAUfBddGzWCo9M//MyBtnXELu6df6bR3aheD/+YVxn5fvcKRwz49AfrdNk/G6jxWwc z+TysCyDdloygKl8xdAhwOpohY3DibXEm5S+zt+Xdhd5DRXVhaGOYz8XqXht/XXLmaBe odhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fR7K0DPm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69631-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69631-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k66-20020a633d45000000b005dbdb1b0114si686608pga.773.2024.02.16.17.10.52 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 17:10:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69631-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fR7K0DPm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-69631-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69631-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 63C36283B0B for <ouuuleilei@gmail.com>; Sat, 17 Feb 2024 01:10:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B540222F0F; Sat, 17 Feb 2024 01:06:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fR7K0DPm" 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 204FB20DC8; Sat, 17 Feb 2024 01:06:02 +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=1708131963; cv=none; b=RE73TTL+6qFg/1fDj7myE63Rrv+tWv9jr9giny4sYddvPJg2UWj8tX7fqhC52aTWcEclOHksiNq+DTbAAosi7Bg2+tyTCQeXl+eloE+NES2iE0Be6VqDxIS1BMMdbdlJmMIQ1SyD8v2ZFvLEPWkOpgaFjHqzGeneMYeMjJLeEHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708131963; c=relaxed/simple; bh=a4ZJdi1g6SmL1slfPXA0Sdc1BiW+RCSDLbBzSuVLxg0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=amxE400CZoowsYw2zfkccLCxp1YC3F4ttIa8iOZILzt8MUB4b0Id6ZmxwrPwWrUGS3BHawDBfk3NcQDHnCidSL0mMUdRCxnOwpvajLfKrO+jGHmnjphmDOcxcj8K+gEtL+wN8uWVljmTlnMKV7cjqD6rpBaB/M/+oixXJX1J57o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fR7K0DPm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 294E0C43394; Sat, 17 Feb 2024 01:06:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708131962; bh=a4ZJdi1g6SmL1slfPXA0Sdc1BiW+RCSDLbBzSuVLxg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fR7K0DPmwLwliOjcvLTQMYx/yhvXd+Lt+J20YtU0eJg9BBupTobaTXvHDKz0ElN1w lyN91Teoqb6L2FiUFaTin94ppj2bXx/OQ+5Zh9nlGBCkw98caMK44i80kS9zuogCk7 mhCc644572dUf8Iq4dDijMBDhsqAR1qvwJuMq095NWCspfbOK6Sumcdd6hlvus4rY5 pJtJzorxKorAn51SisFu2bSBgpRVzJ6rZw7i2j2hIexRCBfO1hTtdhdRp1aExld7zC LS7kGmSBV76MFa+4KC96o2AvD8CCs6u81WWqcJQR/bglZGe4WFTGsxvKciZGKD270o ma7B4X6MmNn+A== 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 v4 6/7] of: unittest: treat missing of_root as error instead of fixing up Date: Fri, 16 Feb 2024 17:05:55 -0800 Message-ID: <20240217010557.2381548-7-sboyd@kernel.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240217010557.2381548-1-sboyd@kernel.org> References: <20240217010557.2381548-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: 1791106484126903917 X-GMAIL-MSGID: 1791106484126903917 |
Series |
of: populate of_root node if bootloader doesn't
|
|
Commit Message
Stephen Boyd
Feb. 17, 2024, 1:05 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 891752a20a5f..4c67de37bf26 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -1744,20 +1744,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;