Skip to content

Commit f4d430d

Browse files
FlyGoattsbogend
authored andcommitted
platform: mips: cpu_hwmon: Disable driver on unsupported hardware
cpu_hwmon is unsupported on CPUs without loongson_chiptemp register and csr. Cc: [email protected] Signed-off-by: Jiaxun Yang <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent c04366b commit f4d430d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/platform/mips/cpu_hwmon.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ static int __init loongson_hwmon_init(void)
139139
csr_temp_enable = csr_readl(LOONGSON_CSR_FEATURES) &
140140
LOONGSON_CSRF_TEMP;
141141

142+
if (!csr_temp_enable && !loongson_chiptemp[0])
143+
return -ENODEV;
144+
142145
nr_packages = loongson_sysconf.nr_cpus /
143146
loongson_sysconf.cores_per_package;
144147

0 commit comments

Comments
 (0)