platform: mips: cpu_hwmon: Disable driver on unsupported hardware
commit f4d430db17b4ef4e9c3c352a04b2fe3c93011978 upstream. cpu_hwmon is unsupported on CPUs without loongson_chiptemp register and csr. Cc: stable@vger.kernel.org Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
2f9bed9e1c
Коммит
4488eef06d
|
@ -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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче