Skip to content

Commit

Permalink
platform: mips: cpu_hwmon: Disable driver on unsupported hardware
Browse files Browse the repository at this point in the history
commit f4d430d upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
FlyGoat authored and gregkh committed Jul 31, 2024
1 parent 21bd5c7 commit 2146177
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/platform/mips/cpu_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2146177

Please sign in to comment.