regulators: dt-bindings: gpio-regulator: Fix "gpios-states" and "states" array bounds
Message ID | 20240224000752.3830665-1-robh@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-79339-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp911458dyb; Fri, 23 Feb 2024 16:08:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXLgRH6isDqxCE2jG4duk/vCihs3BxuF4K+XpPE9RDTy59VXUogX2ChohzP2b2K1lX7652XHc6d4wRkoAhuHheaGOmFWw== X-Google-Smtp-Source: AGHT+IFRkBnCbGnmgciSChOMOKojY//sD07vehJkKvH4CTa6hhm63ftp22ZpdeImaXs++cr+1pPJ X-Received: by 2002:a05:6214:258a:b0:68f:67a9:a9ed with SMTP id fq10-20020a056214258a00b0068f67a9a9edmr1564181qvb.62.1708733306128; Fri, 23 Feb 2024 16:08:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708733306; cv=pass; d=google.com; s=arc-20160816; b=fxwFNu7w+m5sugoT/EJz/4tpWfC8saLpWMcZf2rVsitOyvLnVqoTWGVf63yUlCymI+ HtXwilCzsIZREeUujofY7ElCrvJB6ghZioBJfnO+WdTZP82is54sYsPnKN3Sewal8YvJ TsgGZJlJNM/itUrLRsui5GTcGD5mT/WMYPypX8J0oPEpxba7vIUt8/a2xVFnIK8p93yz bj15OrO06fPoyZtxcN5IuVUtOK+5ytsgp/2JKomppY81Q8tEBXTDteXHl7qQq1YBZvqY bBJ76ReD+Ll8xhAhV7iCm9DO1MU+rJs6LV+Uy34o4iiXy4YU+2cqXNyQZgWstVpb/95N YA7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=sAxDNDs8KCwKabwj7TYhHBBxEJpiy3lzu2Fu5ExzHhA=; fh=U/C+5BUFiD2PZCcR6mGdwNQQRaH3Ka6FVlVJizarWSQ=; b=GaVvvMIVmm8VcYu6fmdYsM17aB401tLsfzZmDAVF1ItgyHNtoQHGT+7KJUT5X9SBlP vR/ufZ2bSOOiO5hKDCVx/bZVQmZY/h7c9xNKxeKsxEiW3msyDnV+JSVb8J9AAaQ6eanV HeYh1FF1EWOMwNEYipr5lKmHYbhrav1sjvrnI5ryjAs1SogBXg1EHrQBZeEIJ+Tzl8qC h3Gv0eIAO/cGJJ+JKFhpYeEfJCmuFxPOKSVuRrl0ZLkys3JzUVHChr6uXmT1ZpAWLbQE W4t5x0A2zuWV9cjzsNKSVngBjttXhqZeyGEW2v8vhhp3lSbWZpCoXSXTDduciR5EIW0n Mgkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=poc3sjpR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79339-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79339-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dv13-20020ad44eed000000b0068cb9a8a39esi45723qvb.216.2024.02.23.16.08.26 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 16:08:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79339-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=poc3sjpR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79339-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79339-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E40191C24629 for <ouuuleilei@gmail.com>; Sat, 24 Feb 2024 00:08:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 979EA10F4; Sat, 24 Feb 2024 00:08:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="poc3sjpR" 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 <robh@kernel.org> To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> 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: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791736734982100525 X-GMAIL-MSGID: 1791736734982100525 |
Series |
regulators: dt-bindings: gpio-regulator: Fix "gpios-states" and "states" array bounds
|
|
Commit Message
Rob Herring
Feb. 24, 2024, 12:07 a.m. UTC
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 <robh@kernel.org>
---
.../devicetree/bindings/regulator/gpio-regulator.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On Fri, 23 Feb 2024 17:07:51 -0700, Rob Herring wrote: > 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. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next Thanks! [1/1] regulators: dt-bindings: gpio-regulator: Fix "gpios-states" and "states" array bounds commit: efe9a6da2292e68d45cd9e0eb1c31b85841d0c2a All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
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