mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
platform: mips: cpu_hwmon: Disable driver on unsupported hardware
commit f4d430db17
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:
parent
6e70fff02f
commit
8e9e1b4b9d
@ -166,6 +166,9 @@ static int __init loongson_hwmon_init(void)
|
||||
goto fail_hwmon_device_register;
|
||||
}
|
||||
|
||||
if (!csr_temp_enable && !loongson_chiptemp[0])
|
||||
return -ENODEV;
|
||||
|
||||
nr_packages = loongson_sysconf.nr_cpus /
|
||||
loongson_sysconf.cores_per_package;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user