Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: firmware: arm,scmi: Restrict protocol child node properties

The SCMI protocol child nodes are missing any constraints on unknown
properties. Specifically, either 'unevaluatedProperties' or
'additionalProperties' is needed. The current structure with a regex
match for all child nodes doesn't work for this purpose, so let's move
the common properties '$defs' entry which each specific protocol node
can reference and set 'unevaluatedProperties: false'.

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20230124222023.316089-1-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>

+33 -10
+33 -10
Documentation/devicetree/bindings/firmware/arm,scmi.yaml
··· 100 100 Channel specifier required when using OP-TEE transport. 101 101 102 102 protocol@11: 103 - type: object 103 + $ref: '#/$defs/protocol-node' 104 + unevaluatedProperties: false 105 + 104 106 properties: 105 107 reg: 106 108 const: 0x11 ··· 114 112 - '#power-domain-cells' 115 113 116 114 protocol@13: 117 - type: object 115 + $ref: '#/$defs/protocol-node' 116 + unevaluatedProperties: false 117 + 118 118 properties: 119 119 reg: 120 120 const: 0x13 ··· 128 124 - '#clock-cells' 129 125 130 126 protocol@14: 131 - type: object 127 + $ref: '#/$defs/protocol-node' 128 + unevaluatedProperties: false 129 + 132 130 properties: 133 131 reg: 134 132 const: 0x14 ··· 142 136 - '#clock-cells' 143 137 144 138 protocol@15: 145 - type: object 139 + $ref: '#/$defs/protocol-node' 140 + unevaluatedProperties: false 141 + 146 142 properties: 147 143 reg: 148 144 const: 0x15 ··· 156 148 - '#thermal-sensor-cells' 157 149 158 150 protocol@16: 159 - type: object 151 + $ref: '#/$defs/protocol-node' 152 + unevaluatedProperties: false 153 + 160 154 properties: 161 155 reg: 162 156 const: 0x16 ··· 170 160 - '#reset-cells' 171 161 172 162 protocol@17: 173 - type: object 163 + $ref: '#/$defs/protocol-node' 164 + unevaluatedProperties: false 165 + 174 166 properties: 175 167 reg: 176 168 const: 0x17 177 169 178 170 regulators: 179 171 type: object 172 + additionalProperties: false 180 173 description: 181 174 The list of all regulators provided by this SCMI controller. 182 175 176 + properties: 177 + '#address-cells': 178 + const: 1 179 + 180 + '#size-cells': 181 + const: 0 182 + 183 183 patternProperties: 184 - '^regulators@[0-9a-f]+$': 184 + '^regulator@[0-9a-f]+$': 185 185 type: object 186 186 $ref: "../regulator/regulator.yaml#" 187 + unevaluatedProperties: false 187 188 188 189 properties: 189 190 reg: ··· 205 184 - reg 206 185 207 186 protocol@18: 208 - type: object 187 + $ref: '#/$defs/protocol-node' 188 + unevaluatedProperties: false 189 + 209 190 properties: 210 191 reg: 211 192 const: 0x18 212 193 213 194 additionalProperties: false 214 195 215 - patternProperties: 216 - '^protocol@[0-9a-f]+$': 196 + $defs: 197 + protocol-node: 217 198 type: object 218 199 description: 219 200 Each sub-node represents a protocol supported. If the platform