blob: f5c250a495bebc1887d304f4065f76d0fae81664 [file] [log] [blame]
From 6e2b8db65902a9ed9d0bb323b915657f14f9c740 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Thu, 19 Jan 2023 11:03:44 +0800
Subject: [PATCH] wifi: mt76: mt7915: rework mt7915_thermal_init()
If the kernel configuration "CONFIG_HWMON" is not set to Y, the
critial/maximum high temperature will not be initialised to the correct
setting. Rework mt7915_thermal_init to fix this.
---
mt7915/init.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mt7915/init.c b/mt7915/init.c
index b23a2fb8..476c1238 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -203,6 +203,10 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
phy->cdev = cdev;
}
+ /* initialize critical/maximum high temperature */
+ phy->throttle_temp[MT7915_CRIT_TEMP_IDX] = MT7915_CRIT_TEMP;
+ phy->throttle_temp[MT7915_MAX_TEMP_IDX] = MT7915_MAX_TEMP;
+
if (!IS_REACHABLE(CONFIG_HWMON))
return 0;
@@ -211,10 +215,6 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
if (IS_ERR(hwmon))
return PTR_ERR(hwmon);
- /* initialize critical/maximum high temperature */
- phy->throttle_temp[MT7915_CRIT_TEMP_IDX] = MT7915_CRIT_TEMP;
- phy->throttle_temp[MT7915_MAX_TEMP_IDX] = MT7915_MAX_TEMP;
-
return 0;
}
--
2.18.0