public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulators: dt-bindings: gpio-regulator: Fix "gpios-states" and "states" array bounds
@ 2024-02-24  0:07 Rob Herring
  2024-02-26 18:30 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2024-02-24  0:07 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-kernel, devicetree

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(-)

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
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulators: dt-bindings: gpio-regulator: Fix "gpios-states" and "states" array bounds
  2024-02-24  0:07 [PATCH] regulators: dt-bindings: gpio-regulator: Fix "gpios-states" and "states" array bounds Rob Herring
@ 2024-02-26 18:30 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2024-02-26 18:30 UTC (permalink / raw)
  To: Liam Girdwood, Krzysztof Kozlowski, Conor Dooley, Rob Herring
  Cc: linux-kernel, devicetree

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-26 18:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-24  0:07 [PATCH] regulators: dt-bindings: gpio-regulator: Fix "gpios-states" and "states" array bounds Rob Herring
2024-02-26 18:30 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox