提交 543c8f2f 编写于 作者: R Rob Herring 提交者: Jonathan Cameron

dt-bindings: iio: temperature: ltc2983: Fix child node unevaluated properties

The child node schemas are missing 'unevaluatedProperties' constraints,
so any unknown properties are allowed. The current structure with
multiple patternProperties schemas doesn't work for
unevaluatedProperties as each sub-schema is evaluated independently. To
fix this, move the sub-schema for all child nodes to a $defs entry and
reference it from each named child node.
Signed-off-by: NRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230404205014.644336-1-robh@kernel.orgSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
上级 7c95a3f5
...@@ -18,6 +18,28 @@ description: | ...@@ -18,6 +18,28 @@ description: |
https://www.analog.com/media/en/technical-documentation/data-sheets/29861fa.pdf https://www.analog.com/media/en/technical-documentation/data-sheets/29861fa.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ltm2985.pdf https://www.analog.com/media/en/technical-documentation/data-sheets/ltm2985.pdf
$defs:
sensor-node:
type: object
description: Sensor node common constraints
properties:
reg:
description:
Channel number. Connects the sensor to the channel with this number
of the device.
minimum: 1
maximum: 20
adi,sensor-type:
description: Type of sensor connected to the device.
$ref: /schemas/types.yaml#/definitions/uint32
required:
- reg
- adi,sensor-type
properties: properties:
compatible: compatible:
oneOf: oneOf:
...@@ -64,28 +86,10 @@ properties: ...@@ -64,28 +86,10 @@ properties:
const: 0 const: 0
patternProperties: patternProperties:
"@([0-9a-f]+)$":
type: object
description: Sensor.
properties:
reg:
description:
Channel number. Connects the sensor to the channel with this number
of the device.
minimum: 1
maximum: 20
adi,sensor-type:
description: Type of sensor connected to the device.
$ref: /schemas/types.yaml#/definitions/uint32
required:
- reg
- adi,sensor-type
"^thermocouple@": "^thermocouple@":
type: object $ref: '#/$defs/sensor-node'
unevaluatedProperties: false
description: Thermocouple sensor. description: Thermocouple sensor.
properties: properties:
...@@ -141,7 +145,9 @@ patternProperties: ...@@ -141,7 +145,9 @@ patternProperties:
- adi,custom-thermocouple - adi,custom-thermocouple
"^diode@": "^diode@":
type: object $ref: '#/$defs/sensor-node'
unevaluatedProperties: false
description: Diode sensor. description: Diode sensor.
properties: properties:
...@@ -184,7 +190,8 @@ patternProperties: ...@@ -184,7 +190,8 @@ patternProperties:
default: 0 default: 0
"^rtd@": "^rtd@":
type: object $ref: '#/$defs/sensor-node'
unevaluatedProperties: false
description: RTD sensor. description: RTD sensor.
properties: properties:
...@@ -282,7 +289,8 @@ patternProperties: ...@@ -282,7 +289,8 @@ patternProperties:
- adi,custom-rtd - adi,custom-rtd
"^thermistor@": "^thermistor@":
type: object $ref: '#/$defs/sensor-node'
unevaluatedProperties: false
description: Thermistor sensor. description: Thermistor sensor.
properties: properties:
...@@ -383,7 +391,8 @@ patternProperties: ...@@ -383,7 +391,8 @@ patternProperties:
- adi,custom-thermistor - adi,custom-thermistor
"^adc@": "^adc@":
type: object $ref: '#/$defs/sensor-node'
unevaluatedProperties: false
description: Direct ADC sensor. description: Direct ADC sensor.
properties: properties:
...@@ -397,7 +406,8 @@ patternProperties: ...@@ -397,7 +406,8 @@ patternProperties:
type: boolean type: boolean
"^temp@": "^temp@":
type: object $ref: '#/$defs/sensor-node'
unevaluatedProperties: false
description: Active analog temperature sensor. description: Active analog temperature sensor.
properties: properties:
...@@ -426,7 +436,8 @@ patternProperties: ...@@ -426,7 +436,8 @@ patternProperties:
- adi,custom-temp - adi,custom-temp
"^rsense@": "^rsense@":
type: object $ref: '#/$defs/sensor-node'
unevaluatedProperties: false
description: Sense resistor sensor. description: Sense resistor sensor.
properties: properties:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册