From patchwork Sat Feb 24 00:07:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 1903692 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=poc3sjpR; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:40f1:3f00::1; helo=sy.mirrors.kernel.org; envelope-from=devicetree+bounces-45478-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [IPv6:2604:1380:40f1:3f00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4ThRzl251Yz23f7 for ; Sat, 24 Feb 2024 11:08:19 +1100 (AEDT) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7FF00B24593 for ; Sat, 24 Feb 2024 00:08:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 611BC38D; Sat, 24 Feb 2024 00:08:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="poc3sjpR" X-Original-To: devicetree@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01040182; Sat, 24 Feb 2024 00:08:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708733293; cv=none; b=jCLovEcyACF8SJCyyFnMnnxKrnpeQc5PhdpN/5AdIX6XZwddg/QPKWJ8ZWrJQaSVG4LigV4wQPr0Xwu10UFuhhvVQA1D0ZkpuP078xqdCsnbpUEGbxh92GNcrndLdFOMzDqVOeXSDule1aMVqQUWvVVhWsn1I70JrkhnZlkJDtg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708733293; c=relaxed/simple; bh=ajpTJsTTp0MgBwoG+Xc7ugNQltQSLk5IW3xSgWzGdRc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nHiy7G/jNSRpAzypZP3LQzZuiLBTb0cq7WnE70lo/HGmfkDEsVjXqLylKOQtf/CSCt3lRNebCWRqVuPNeRxIOZ7dglDDnUA+wG+dIKsS5cnpNSSERXUhvrRTtsqE7h0NDeXjqLFBxu8m+6kLzlzhxewG9dHnBc+ewk07Xox130M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=poc3sjpR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 435B1C433C7; Sat, 24 Feb 2024 00:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708733292; bh=ajpTJsTTp0MgBwoG+Xc7ugNQltQSLk5IW3xSgWzGdRc=; h=From:To:Cc:Subject:Date:From; b=poc3sjpRxABHFj6+RdIKH9bzBibIM3yiGZza+h9X+eoTrswGlkGvP8MQejfsFzRN+ LneOiVAxpgJIexV7pjx4QTKbViOB3lwg3HVvchX8e3BIKpCwtr9EMcbXK+Mm9FUpOf N/l7lznQNIc/DEbfXLbxyPDrODaobq+vYdXYU08uL0InuCm0OyWQyGMdOBs4wPpiLK 7ZmQQt0l6gchvLZcJGIS5lWIGYhjugoF7eBCNFG5r+AuhU7czHqbpopKhhEtlo6rrs n1e3AFGyFq6B0VX9cylw7rPalbPZx0sdGIx7hlIHou1p5CkCRWFgSMOX6gcjFsRD9z ZGtkhtSF8FmZw== From: Rob Herring To: Liam Girdwood , Mark Brown , Krzysztof Kozlowski , Conor Dooley Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH] regulators: dt-bindings: gpio-regulator: Fix "gpios-states" and "states" array bounds Date: Fri, 23 Feb 2024 17:07:51 -0700 Message-ID: <20240224000752.3830665-1-robh@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The minimum number of array entries for "gpios-states" was not not specified, so the the default is the same as the max (8). The minimum is also missing from "states", and the maximum is also wrong as it should be 2^(# of GPIO lines). Since there can be 1 to 8 GPIOs, the "states" range should be 2 to 256. Signed-off-by: Rob Herring --- .../devicetree/bindings/regulator/gpio-regulator.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.yaml b/Documentation/devicetree/bindings/regulator/gpio-regulator.yaml index f4c1f36e52e9..a34e85754658 100644 --- a/Documentation/devicetree/bindings/regulator/gpio-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.yaml @@ -47,6 +47,7 @@ properties: 1: HIGH Default is LOW if nothing else is specified. $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 maxItems: 8 items: enum: [0, 1] @@ -57,7 +58,8 @@ properties: regulator and matching GPIO configurations to achieve them. If there are no states in the "states" array, use a fixed regulator instead. $ref: /schemas/types.yaml#/definitions/uint32-matrix - maxItems: 8 + minItems: 2 + maxItems: 256 items: items: - description: Voltage in microvolts