提交 5eb56522 编写于 作者: K Krzysztof Kozlowski 提交者: Dmitry Torokhov

dt-bindings: input: gpio-keys: enforce node names to match all properties

The gpio-keys DT schema matches all properties with a wide pattern and
applies specific schema to children.  This has drawback - all regular
properties are also matched and are silently ignored, even if they are
not described in schema.  Basically this allows any non-object property
to be present.

Enforce specific naming pattern for children (keys) to narrow the
pattern thus do not match other properties.  This will require all
children to be properly prefixed or suffixed (button, event, switch or
key).

Removal of "if:" within patternProperties causes drop of one indentation
level, but there are no other changes in the affected block.
Signed-off-by: NKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: NRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220705120356.94876-2-krzysztof.kozlowski@linaro.orgSigned-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 538c6406
...@@ -16,10 +16,7 @@ properties: ...@@ -16,10 +16,7 @@ properties:
- gpio-keys-polled - gpio-keys-polled
patternProperties: patternProperties:
".*": "^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$":
if:
type: object
then:
$ref: input.yaml# $ref: input.yaml#
properties: properties:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册