From: Guenter Roeck Date: Wed, 25 Apr 2018 01:04:34 +0000 (-0700) Subject: Improve compatibility with different kernel versions X-Git-Url: https://git.sur5r.net/?p=groeck-k10temp;a=commitdiff_plain;h=484671790fb733076483e28585865d3012029466 Improve compatibility with different kernel versions x86_mask has been renamed to x86_stepping. --- diff --git a/compat.h b/compat.h new file mode 100644 index 0000000..345a17e --- /dev/null +++ b/compat.h @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------- + * + * compat.h + * Copyright (c) 2018 Guenter Roeck + * + *--------------------------------------------------------------------------- + */ + +#ifndef COMPAT_H +#define COMPAT_H + +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) +#define x86_stepping x86_mask +#endif + +#endif /* COMPAT_H */ diff --git a/k10temp.c b/k10temp.c index e4a179d..6f8ffb9 100644 --- a/k10temp.c +++ b/k10temp.c @@ -24,6 +24,7 @@ #include #include #include +#include "compat.h" MODULE_DESCRIPTION("AMD Family 10h+ CPU core temperature monitor"); MODULE_AUTHOR("Clemens Ladisch "); @@ -234,7 +235,7 @@ static bool has_erratum_319(struct pci_dev *pdev) * and AM3 formats, but that's the best we can do. */ return boot_cpu_data.x86_model < 4 || - (boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_mask <= 2); + (boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_stepping <= 2); } static int k10temp_probe(struct pci_dev *pdev,