[Skiboot] [PATCH 2/3] sensors: Fix dtc warning for dts sensors.

Stewart Smith stewart at linux.vnet.ibm.com
Fri Dec 1 17:45:12 AEDT 2017


Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com> writes:
> 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 at 5c has a unit name, but no reg property
> /ibm,opal/sensors/core-temp at 804 has a unit name, but no reg property
>
> This patch fixes this by adding necessary properties.
>
> Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>
> ---
>  core/sensor.c | 2 ++
>  hw/dts.c      | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/core/sensor.c b/core/sensor.c
> index 57b21bc..6d5fd42 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 */
> diff --git a/hw/dts.c b/hw/dts.c
> index a10df58..53a3123 100644
> --- a/hw/dts.c
> +++ b/hw/dts.c
> @@ -402,6 +402,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", c->pir);
>  			dt_add_property_string(node, "label", "Core");
>  		}
>  	}
> @@ -428,6 +429,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", chip_id);
>  		dt_add_property_string(node, "label", "Centaur");
>  	}

Series merged to master as of e8248d22600e421984b52f81c6da2c5a9e04a891
with the one change of doing the handle here as the "register" rather
than chip_id/pir

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list