From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764802AbdJQXiX (ORCPT ); Tue, 17 Oct 2017 19:38:23 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:53863 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764760AbdJQXgx (ORCPT ); Tue, 17 Oct 2017 19:36:53 -0400 X-Google-Smtp-Source: AOwi7QDxdEfGeoPOF4o3jLGw+gGVv0xIfkiCcS73iTgWrd0KyJ15phQlOohuXPLLB8fbamidBJ1lDw== From: frowand.list@gmail.com To: Rob Herring , Pantelis Antoniou , David Airlie , Jyri Sarha Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Tomi Valkeinen , dri-devel@lists.freedesktop.org Subject: [PATCH v3 08/12] of: overlay: loosen overly strict phandle clash check Date: Tue, 17 Oct 2017 16:36:28 -0700 Message-Id: <1508283392-18252-9-git-send-email-frowand.list@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508283392-18252-1-git-send-email-frowand.list@gmail.com> References: <1508283392-18252-1-git-send-email-frowand.list@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 4cdee169a5ab..791753321ed2 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -311,10 +311,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; -- Frank Rowand