Commit f4d430db authored by Jiaxun Yang's avatar Jiaxun Yang Committed by Thomas Bogendoerfer

platform: mips: cpu_hwmon: Disable driver on unsupported hardware

cpu_hwmon is unsupported on CPUs without loongson_chiptemp
register and csr.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent c04366b1
......@@ -139,6 +139,9 @@ static int __init loongson_hwmon_init(void)
csr_temp_enable = csr_readl(LOONGSON_CSR_FEATURES) &
LOONGSON_CSRF_TEMP;
if (!csr_temp_enable && !loongson_chiptemp[0])
return -ENODEV;
nr_packages = loongson_sysconf.nr_cpus /
loongson_sysconf.cores_per_package;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment