From patchwork Mon Oct 23 14:41:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13432976 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA972C001E0 for ; Mon, 23 Oct 2023 14:43:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233801AbjJWOnT (ORCPT ); Mon, 23 Oct 2023 10:43:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233847AbjJWOmv (ORCPT ); Mon, 23 Oct 2023 10:42:51 -0400 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 375C92127 for ; Mon, 23 Oct 2023 07:41:40 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:375d:2b56:c03f:d72d]) by andre.telenet-ops.be with bizsmtp id 1Shd2B00U3CbNjd01ShdCU; Mon, 23 Oct 2023 16:41:38 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1quw7W-007KKf-NH; Mon, 23 Oct 2023 16:41:37 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1quw7d-007tac-Iq; Mon, 23 Oct 2023 16:41:37 +0200 From: Geert Uytterhoeven To: Rob Herring Cc: Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH dt-schema] schemas: gpio: gpio-consumer: Fix false positives on nodes named gpio Date: Mon, 23 Oct 2023 16:41:34 +0200 Message-Id: <20231023144134.1881973-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Just like for "gpio", nodes can be named "gpios" or "-gpio(s)", causing false positive failures. See also commit 80120fccde170902 ("schemas: gpio: fix false positive failures on nodes named 'gpio'"). Signed-off-by: Geert Uytterhoeven --- Seen on Linux, e.g.: arch/arm/boot/dts/renesas/r8a7779-marzen.dtb: /: keyboard-gpio: {'compatible': ['gpio-keys-polled'], 'poll-interval': [[50]], 'pinctrl-0': [[29]], 'pinctrl-names': ['default'], 'key-3': {'gpios': [[28, 19, 1]], 'linux,code': [[4]], 'label': ['SW1-3'], 'debounce-interval': [[20]]}, 'key-4': {'gpios': [[28, 20, 1]], 'linux,code': [[5]], 'label': ['SW1-4'], 'debounce-interval': [[20]]}} is not of type 'array' from schema $id: http://devicetree.org/schemas/gpio/gpio-consumer.yaml# arch/arm/boot/dts/renesas/r8a7779-marzen.dtb: pinctrl@fffc0000: keyboard-gpio: {'pins': ['GP_0_19', 'GP_0_20'], 'bias-pull-up': True, 'phandle': [[29]]} is not of type 'array' from schema $id: http://devicetree.org/schemas/gpio/gpio-consumer.yaml# arch/arm/boot/dts/microchip/at91-kizbox3-hs.dtb: /: gpios: {'compatible': ['gpio'], 'status': ['okay'], 'rf_on': {'label': ['rf on'], 'gpio': [[38, 83, 0]], 'output': True, 'init-low': True}, 'wifi_on': {'label': ['wifi on'], 'gpio': [[38, 84, 0]], 'output': True, 'init-low': True}, 'zbe_test_radio': {'label': ['zbe test radio'], 'gpio': [[38, 53, 0]], 'output': True, 'init-low': True}, 'zbe_rst': {'label': ['zbe rst'], 'gpio': [[38, 57, 0]], 'output': True, 'init-low': True}, 'io_reset': {'label': ['io reset'], 'gpio': [[38, 62, 0]], 'output': True, 'init-low': True}, 'io_test_radio': {'label': ['io test radio'], 'gpio': [[38, 73, 0]], 'output': True, 'init-low': True}, 'io_boot_0': {'label': ['io boot 0'], 'gpio': [[38, 75, 0]], 'output': True, 'init-low': True}, 'io_boot_1': {'label': ['io boot 1'], 'gpio': [[38, 81, 0]], 'output': True, 'init-low': True}, 'verbose_bootloader': {'label': ['verbose bootloader'], 'gpio': [[38, 43, 0]], 'input': True}, 'nail_bed_detection': {'label': ['nail bed detection'], 'gpio': [[38, 44, 0]], 'input': True}, 'id_usba': {'label': ['id usba'], 'gpio': [[38, 64, 1]], 'input': True}} is not of type 'array' from schema $id: http://devicetree.org/schemas/gpio/gpio-consumer.yaml# For marzen, the alternative fix would be to s/keyboard-gpio/keyboard-polled/g. --- dtschema/schemas/gpio/gpio-consumer.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dtschema/schemas/gpio/gpio-consumer.yaml b/dtschema/schemas/gpio/gpio-consumer.yaml index 1ac35244de7317bc..9572a9cd0febef19 100644 --- a/dtschema/schemas/gpio/gpio-consumer.yaml +++ b/dtschema/schemas/gpio/gpio-consumer.yaml @@ -17,7 +17,10 @@ select: properties: gpios: - $ref: /schemas/types.yaml#/definitions/phandle-array + # 'gpios' can appear as a property or node name + oneOf: + - type: object + - $ref: /schemas/types.yaml#/definitions/phandle-array gpio: # 'gpio' can appear as a property or node name @@ -28,6 +31,9 @@ properties: patternProperties: "(?