From patchwork Tue Oct 17 23:36:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Rowand X-Patchwork-Id: 10014047 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 3CD9560215 for ; Wed, 18 Oct 2017 08:19:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C81B28A96 for ; Wed, 18 Oct 2017 08:19:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2157828AF0; Wed, 18 Oct 2017 08:19:01 +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 BCE6E28A96 for ; Wed, 18 Oct 2017 08:19:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10D7889C85; Wed, 18 Oct 2017 08:17:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id E3A156E7B7 for ; Tue, 17 Oct 2017 23:36:52 +0000 (UTC) Received: by mail-pf0-x242.google.com with SMTP id i5so2508020pfe.6 for ; Tue, 17 Oct 2017 16:36:52 -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=Sm/fT5UK9MIhGbXofE6NTxglZc5MmWuESDFnaWQS5cA=; b=a57HDW1qZg/zswOIJuOfLj9RLV7hSXaA3oLvfQTmFC/lhkrJM1JF+H8lY8JaAE/PpO jeLRiI8tVWBbM/9SLdt+nR2sdeQnFmc7QxYXNPO72gcncUxtHClolUj6cYPip4eH1R4F KN5sGwcCLFY1wY61iDs2zVZ2qzrl2rbTBqaZQyFrPUNe6ERpKHW9Cp+qtmfPOjCsCtuy wSjoZh/oXygIZ7F1euE5p/khs++7LOfwVGbzEclBzSXHWxh0CoSdGpROp7+tgjTolqrP w4tVw3ZrlgDElldhxxc4NjLjUSRcu8S6YV0dP8/lovBkq+Q0P1hk6NDp4e4QzPNJN1OR svGg== 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=Sm/fT5UK9MIhGbXofE6NTxglZc5MmWuESDFnaWQS5cA=; b=JRvzK7w5sx2Ehi4Zd1SUBbWoMAY08BVshj+3OE7DFJJBGiENLL66GM8EZANIkSmvC3 tqmfXRN+IyJtOj+XpJHcm7/wDcbe5Bgdd49SplAYBlzi3nOhfiBgKDmZCzDMbbAaflTW 22l6lvt5WunVw1lXJ8W6draj1vWPE2xJyTFW9SYoW7Bq/t2AgENyv1brFS4nVFpbs++J OHnBmh8/77Due+QK4MucUPXmPZ3xEEmVJljgx8LB5uN0W3/McEi8a3Qf9bqyxQ8wgbMV p0M4Fv74jCrDyxzDT2EkYE0FYW0NB/oaZ7xixER/rST3ktsIV2bs2JO0sEjCrX/eAU43 aSEw== X-Gm-Message-State: AMCzsaXiK72qyDTabWghJm/dpwEf4v74pLayvhO/o34EOvi+cjkE+xMT j6s42L6zcMgr/+L/VA8t5qE= X-Google-Smtp-Source: AOwi7QDxdEfGeoPOF4o3jLGw+gGVv0xIfkiCcS73iTgWrd0KyJ15phQlOohuXPLLB8fbamidBJ1lDw== X-Received: by 10.101.74.193 with SMTP id c1mr12378492pgu.260.1508283412521; Tue, 17 Oct 2017 16:36:52 -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 76sm21185562pfq.4.2017.10.17.16.36.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Oct 2017 16:36:52 -0700 (PDT) From: frowand.list@gmail.com To: Rob Herring , Pantelis Antoniou , David Airlie , Jyri Sarha 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> X-Mailman-Approved-At: Wed, 18 Oct 2017 08:17:10 +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 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;