[1/3] hw/occ: Fix psr cpu-to-gpu sensors node dtc warning.

Message ID 1508511452-26744-1-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/power-mgt/psr/cpu-to-gpu@0 has a unit name, but no reg property
/ibm,opal/power-mgt/psr/cpu-to-gpu@100 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>
---
 hw/occ.c | 3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/hw/occ.c b/hw/occ.c
index 78c6a6a..6fde8b4 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -1442,6 +1442,8 @@  static void occ_add_psr_sensors(struct dt_node *power_mgt)
 
 	dt_add_property_string(node, "compatible",
 			       "ibm,opal-power-shift-ratio");
+	dt_add_property_cells(node, "#address-cells", 1);
+	dt_add_property_cells(node, "#size-cells", 0);
 	for (i = 0; i < nr_occs; i++) {
 		struct dt_node *cnode;
 		char name[20];
@@ -1457,6 +1459,7 @@  static void occ_add_psr_sensors(struct dt_node *power_mgt)
 		snprintf(name, 20, "cpu_to_gpu_%d", chips[i].chip_id);
 		dt_add_property_string(cnode, "label", name);
 		dt_add_property_cells(cnode, "handle", handle);
+		dt_add_property_cells(cnode, "reg", chips[i].chip_id);
 	}
 }