blob: 0494b402d2bda4aa45f2f6ad9817ce03086acf4c [file] [log] [blame]
From e4a095d551a5d2252887b88d064dee43fcb4149d 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 ec297e04..8485a154 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -202,6 +202,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;
@@ -210,10 +214,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