Skip to contentSkip to conversation

thermal: rcar_gen3_thermal: Fix to show correct trip points number

PATCH New Jiada Wang 1 participant 1 message May 9, 2019

Subsystems (2)
lore
Share & tools
lore

Jiada Wang

author
#0 lore raw

PATCH 1/1 thermal: rcar_gen3_thermal: Fix to show correct trip points number

Currently after store trip points number in 'ret', it is overwritten afterwards, this cause incorrect trip point number always be shown in the debug information after register of each thermal zone.

This patch fix this issue by moving get of trip number to end of thermal zone registration.

Fixes 6269e9f790e8d ("thermal: rcar_gen3_thermal: Register hwmon sysfs interface")
---
 drivers/thermal/rcar_gen3_thermal.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/thermal/rcar_gen3_thermal.c +4 -4
index 88fa41cf16e8..5083e602935c 100644
@@ -433,10 +433,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
 		}
 		tsc->zone = zone;
 
-		ret = of_thermal_get_ntrips(tsc->zone);
-		if (ret < 0)
-			goto error_unregister;
-
 		tsc->zone->tzp->no_hwmon = false;
 		ret = thermal_add_hwmon_sysfs(tsc->zone);
 		if (ret)
@@ -448,6 +444,10 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
 			goto error_unregister;
 		}
 
+		ret = of_thermal_get_ntrips(tsc->zone);
+		if (ret < 0)
+			goto error_unregister;
+
 		dev_info(dev, "TSC%d: Loaded %d trip points\n", i, ret);
 	}
 
Signature · 1 line
2.19.2