From patchwork Tue Oct 3 03:53:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Rowand X-Patchwork-Id: 9981879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1396760291 for ; Tue, 3 Oct 2017 07:20:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 066E028249 for ; Tue, 3 Oct 2017 07:20:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF152286C1; Tue, 3 Oct 2017 07:20:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BAE4828249 for ; Tue, 3 Oct 2017 07:20:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91E3B6E401; Tue, 3 Oct 2017 07:19:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 747476E3A0 for ; Tue, 3 Oct 2017 03:54:13 +0000 (UTC) Received: by mail-pg0-x242.google.com with SMTP id p5so5804165pgn.2 for ; Mon, 02 Oct 2017 20:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YLBs9kKTG/GLWDQs8ny3/KYzFoAw8uGrObGOT1/hEeM=; b=IExhr+sREuFC6A6/SV4yVGI/NiP5w1wgCY04VW6soUA7C9sPIzqwKQkAY00rcn4Tus g6oYRc3MnZ2fqEsHgqUODFpfJKSf+pVvvz0BSKorUHYSx66Ye5CrqUh0LXDZwuR9o4/F e8Ib9EiR5v/7K1AJgq4xGdhRa8HCg9pihcptAZp04TBeDNYLfzZSAePXJi95tZaPz5iL JIk1XM8aXxn43R9k75WwBFPShgfE3VPcrdu6kE4oE4RmTp4Sn2METsNCv2gkiEHzJeX9 H7GYHN+N0MwEXEibt5ERVbiZkoXPtIzl2tXfnsLveWcgtGpnSMtCXDKM2ppBYIO+oOuZ yM8Q== 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=YLBs9kKTG/GLWDQs8ny3/KYzFoAw8uGrObGOT1/hEeM=; b=Ewvk6jA6u/fwWf0ewpWaejiaMXC8fEZZ+2EIYt8iziQL0o5uaole+yzqBSLwDH6LPm nW2ViAHt240fSjIwHCXN8iNj5AClCgUWOZA52ffgHaUk17LIrdDoxXvpSex7URGoNJOu XyiMxXlC6rumHXGfwgAmucvpAyiC3QVDBRPLn3iZwT5FAvetxsBGU7IXieaz8GwqDwhx G4jquvh4kri5NlQKwzZNA5hE9sLhfQGBqZarCxXuxIe8p+GhB2jen2R4MAMnQ0idtl0p 8o3U4NHMGdAtPBEpLg4dLODB14GK3/KKrP+91015Q+Emhy65oGBdd8ouRDUQBrzym0ms jPig== X-Gm-Message-State: AHPjjUgTjioghQpL2fuTFk7CudxQ7GfNbG4BLhwTnku9ewOvIbQge1p2 h6IOjAqWK6s4c4WB02Ryxas= X-Google-Smtp-Source: AOwi7QA187uvRrD4hkHo019u8hHIxWP01psoA+/8cwY9ZSdnCy0cE+t+P54fGlLIUjMFgU44y4ZjvA== X-Received: by 10.99.117.65 with SMTP id f1mr14447291pgn.104.1507002852873; Mon, 02 Oct 2017 20:54:12 -0700 (PDT) Received: from localhost.localdomain (c-73-93-215-6.hsd1.ca.comcast.net. [73.93.215.6]) by smtp.gmail.com with ESMTPSA id c16sm18609930pfj.123.2017.10.02.20.54.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Oct 2017 20:54:12 -0700 (PDT) From: frowand.list@gmail.com To: Rob Herring , Pantelis Antoniou , David Airlie , Jyri Sarha Subject: [PATCH 08/12] of: overlay: loosen overly strict phandle clash check Date: Mon, 2 Oct 2017 20:53:42 -0700 Message-Id: <1507002826-16393-9-git-send-email-frowand.list@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507002826-16393-1-git-send-email-frowand.list@gmail.com> References: <1507002826-16393-1-git-send-email-frowand.list@gmail.com> X-Mailman-Approved-At: Tue, 03 Oct 2017 07:19:35 +0000 Cc: Mark Rutland , devicetree@vger.kernel.org, Tomi Valkeinen , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Frank Rowand When an overlay contains a node that already exists in the live device tree, the overlay node is not allowed to change the phandle of the existing node. The existing check refused to allow an overlay node to set the node phandle even when the existing node did not have a phandle. Relax the check to allow an overlay node to set the phandle value if the existing node does not have a phandle. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 015d8b112f60..a0d3222febdc 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -302,10 +302,10 @@ static int add_changeset_node(struct overlay_changeset *ovcs, return build_changeset_next_level(ovcs, tchild, node, 0); } - if (node->phandle) - return -EINVAL; - - ret = build_changeset_next_level(ovcs, tchild, node, 0); + if (node->phandle && tchild->phandle) + ret = -EINVAL; + else + ret = build_changeset_next_level(ovcs, tchild, node, 0); of_node_put(tchild); return ret;