[3/3] sensors: Fix dtc warning for new occ inband sensors.

Message ID 1508511452-26744-3-git-send-email-ppaidipe@linux.vnet.ibm.com
State New
Headers show
Series
  • [1/3] hw/occ: Fix psr cpu-to-gpu sensors node dtc warning.
Related show

Commit Message

Pridhiviraj Paidipeddi Oct. 20, 2017, 2:57 p.m.
dtc complains about missing reg property when a DT node is having a
unit name or address but no reg property.

/ibm,opal/sensors/vrm-in@c00004 has a unit name, but no reg property
/ibm,opal/sensors/gpu-in@c0001f has a unit name, but no reg property
/ibm,opal/sensor-groups/occ-js@1c00040 has a unit name, but no reg property

This patch fixes these warnings for new occ inband sensors and also for
sensor-groups by adding necessary properties.

Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
---
 hw/occ-sensor.c | 3 +++
 hw/occ.c        | 1 +
 2 files changed, 4 insertions(+)

Patch

diff --git a/hw/occ-sensor.c b/hw/occ-sensor.c
index 1042c11..bcb7627 100644
--- a/hw/occ-sensor.c
+++ b/hw/occ-sensor.c
@@ -568,6 +568,8 @@  void occ_sensors_init(void)
 		return;
 	}
 	dt_add_property_string(sg, "compatible", "ibm,opal-sensor-group");
+	dt_add_property_cells(sg, "#address-cells", 1);
+	dt_add_property_cells(sg, "#size-cells", 0);
 
 	for_each_chip(chip) {
 		struct occ_sensor_data_header *hb;
@@ -613,6 +615,7 @@  void occ_sensors_init(void)
 
 			dt_add_property_string(node, "sensor-type", type);
 			dt_add_property_cells(node, "sensor-data", handler);
+			dt_add_property_cells(node, "reg", handler);
 
 			handler = sensor_handler(occ_num, i, SENSOR_CSM_MAX);
 			dt_add_property_cells(node, "sensor-data-max", handler);
diff --git a/hw/occ.c b/hw/occ.c
index 6fde8b4..318e2f1 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -1537,6 +1537,7 @@  void occ_add_sensor_groups(struct dt_node *sg, u32 *phandles, int nr_phandles,
 		dt_add_property_cells(node, "ibm,chip-id", chipid);
 		dt_add_property(node, "sensors", phandles, nr_phandles);
 		dt_add_property_cells(node, "ops", OPAL_SENSOR_GROUP_CLEAR);
+		dt_add_property_cells(node, "reg", handle);
 	}
 }