Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4014543ybz; Tue, 28 Apr 2020 04:22:47 -0700 (PDT) X-Google-Smtp-Source: APiQypIVERNW2Kz/EGTJJgo+7t15yg7RwGYf2nTcxz94YXRjYr0AmKDCCfPptqrbgrw1hjouT6Pu X-Received: by 2002:a17:906:a38f:: with SMTP id k15mr24891900ejz.181.1588072966890; Tue, 28 Apr 2020 04:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588072966; cv=none; d=google.com; s=arc-20160816; b=AHPhqOEF/yEYbw8j5Eja/qn0vKBUzfBYtiucLQE2RWY6jb08t2z5b5ZxHJyMg3V9Gm /Je5hQGeKxdlF8NyItP1Nle6sFD2Uf6fcBQBOa35Fl+GLG9y/vCuaBgQsePrnR3KWwxq b+Xmj9oHXFLkefaLDQhYDshvZrR9gFfbETrpPJHKPukUfQyzT7ix6SY2yv8TR/ILLOIw GU0rx4c7BYu9/510i20799VkeMHhw8UHUlDzuHc1x2Yph0VNZdHgPt9sA/jiUC2uD5eA +hrg7bYpMn+R4OLKhiKalqI3mWMOBGYE3PfVyZ9LocO03Cv1K2OdENlSwOIwM+ieIquT OCLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=w25x9OS75va938AbxmRla/yZ0mHCA8BPmkJtiNOLjko=; b=CjkyPjLK3LNfpA6DA6iMgZcU0MHlp6AZ+QVt+fs8sT7mwNCExe7LpUXmXy8oY6vDyF VpWaBj7rAUDoYgkbYByd3UhVlni1WRmNjqNb3lJAhCc7dyeoFjkwWCtJE4MmQbFa60du Fg4Pv+qVJ40Z0OrGzrJS/7B6RLPKlfZ0sdWZVGlZI++W66PexIgRQUPp0PgqaNdHoqIx ByfLdD3uXU9a0co4PAmDXNZ8Yr+WeuXIxaGjOr12GJydzOtGZ6gXBAzpICDgJdylep7O s8x/YWW/3a7jk9g8oFz7p2F/tsdAfCZR3vLUs5+vuhMRSCEsM778QZ4uq+9a92RJLTn+ cm1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nm2si1720866ejb.243.2020.04.28.04.22.23; Tue, 28 Apr 2020 04:22:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726798AbgD1LSv (ORCPT + 99 others); Tue, 28 Apr 2020 07:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726750AbgD1LSt (ORCPT ); Tue, 28 Apr 2020 07:18:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83B3FC03C1A9 for ; Tue, 28 Apr 2020 04:18:49 -0700 (PDT) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTOGC-0000SP-8u; Tue, 28 Apr 2020 13:18:44 +0200 Received: from afa by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1jTOGB-0007Mt-K0; Tue, 28 Apr 2020 13:18:43 +0200 From: Ahmad Fatoum To: Srinivas Kandagatla Cc: kernel@pengutronix.de, ceggers@arri.de, Ahmad Fatoum , Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] dt-bindings: nvmem: skip nodes with compatibles other than "nvmem-cell" Date: Tue, 28 Apr 2020 13:18:26 +0200 Message-Id: <20200428111829.2215-2-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200428111829.2215-1-a.fatoum@pengutronix.de> References: <20200428111829.2215-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: afa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For nodes matching the nvmem binding, all child objects matching "^.*@[0-9a-f]+$" are assumed to be nvmem cells, without taking a compatible into account. This precludes: - future extension of e.g. eeprom nodes by any child nodes other than nvmem cells - extending the NVMEM binding to nodes that already have other child nodes, e.g., MTD and its partitions To allow co-existence of nvmem-cells with other nodes, loosen the binding to consult an optional compatible property for the cells: - if a compatible exists, it must be "nvmem-cell" - if none exists, it's assumed to be a nvmem cell, like before As additionalProperties: false was specified for nvmem-cell bindings, a compatible property was so far invalid. This means no already compliant device tree should be reinterpreted differently after this binding adjustment and in that regard, the change is completely backwards-compatible. This resolves an existing clash between this nvmem-cell binding and the barebox bootloader binding that extends the fixed-partitions MTD binding to EEPROMs. Signed-off-by: Ahmad Fatoum --- Documentation/devicetree/bindings/nvmem/nvmem.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml index 65980224d550..c39f5dd7e1aa 100644 --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml @@ -44,9 +44,21 @@ properties: patternProperties: "^.*@[0-9a-f]+$": - type: object + if: + properties: + compatible: + items: + const: nvmem-cell + then: + $ref: "#/definitions/nvmem-cell" +definitions: + nvmem-cell: properties: + compatible: + items: + const: nvmem-cell + reg: maxItems: 1 description: -- 2.26.2