diff options
author | Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> | 2017-10-20 20:27:31 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-11-30 23:52:25 -0600 |
commit | 3e808354c311e40925bf53ed5ce9a872a5750141 (patch) | |
tree | db88839e9e2cd4879440f67f1a2f2d53ad3a1f8b | |
parent | c4f12c22ee95e2cdeb8f269740ecca0e8e76cbbd (diff) | |
download | blackbird-skiboot-3e808354c311e40925bf53ed5ce9a872a5750141.tar.gz blackbird-skiboot-3e808354c311e40925bf53ed5ce9a872a5750141.zip |
sensors: Fix dtc warning for dts sensors.
dtc complains about missing reg property when a DT node is having a
unit name or address but no reg property.
Example warning for core dts sensor:
/ibm,opal/sensors/core-temp@5c has a unit name, but no reg property
/ibm,opal/sensors/core-temp@804 has a unit name, but no reg property
This patch fixes this by adding necessary properties.
Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
[stewart: use handle as register rather than chip id]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/sensor.c | 2 | ||||
-rw-r--r-- | hw/dts.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/core/sensor.c b/core/sensor.c index 0e2a5ca3..ff726365 100644 --- a/core/sensor.c +++ b/core/sensor.c @@ -58,6 +58,8 @@ void sensor_init(void) sensor_node = dt_new(opal_node, "sensors"); dt_add_property_string(sensor_node, "compatible", "ibm,opal-sensor"); + dt_add_property_cells(sensor_node, "#address-cells", 1); + dt_add_property_cells(sensor_node, "#size-cells", 0); dts_sensor_create_nodes(sensor_node); /* Register OPAL interface */ @@ -476,6 +476,7 @@ bool dts_sensor_create_nodes(struct dt_node *sensors) dt_add_property_cells(node, "sensor-status", handler); dt_add_property_string(node, "sensor-type", "temp"); dt_add_property_cells(node, "ibm,pir", c->pir); + dt_add_property_cells(node, "reg", handler); dt_add_property_string(node, "label", "Core"); init_timer(&c->dts_timer, dts_async_read_temp, c); c->dts_read_in_progress = false; @@ -504,6 +505,7 @@ bool dts_sensor_create_nodes(struct dt_node *sensors) dt_add_property_cells(node, "sensor-status", handler); dt_add_property_string(node, "sensor-type", "temp"); dt_add_property_cells(node, "ibm,chip-id", chip_id); + dt_add_property_cells(node, "reg", handler); dt_add_property_string(node, "label", "Centaur"); } |