Skip to content

Commit

Permalink
thermal: armada: Give meaningful names to the thermal zones
Browse files Browse the repository at this point in the history
After registration to the thermal core, sysfs will make one entry
per instance of the driver in /sys/class/thermal_zoneX and
/sys/class/hwmon/hwmonX, X being the index of the instance, all of them
having the type/name "armada_thermal".

Until now there was only one thermal zone per SoC but SoCs like Armada
A7K and Armada A8K have respectively two and three thermal zones (one
per AP and one per CP) and this number is subject to grow in the future.

Use dev_name() instead of the "armada_thermal" string to get a
meaningful name and be able to identify the thermal zones from
userspace.

Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
  • Loading branch information
Miquel Raynal authored and Eduardo Valentin committed Jan 1, 2018
1 parent 6416368 commit f80ee03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/thermal/armada_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ static int armada_thermal_probe(struct platform_device *pdev)

priv->data->init_sensor(pdev, priv);

thermal = thermal_zone_device_register("armada_thermal", 0, 0,
priv, &ops, NULL, 0, 0);
thermal = thermal_zone_device_register(dev_name(&pdev->dev), 0, 0, priv,
&ops, NULL, 0, 0);
if (IS_ERR(thermal)) {
dev_err(&pdev->dev,
"Failed to register thermal zone device\n");
Expand Down

0 comments on commit f80ee03

Please sign in to comment.