X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fhwmon%2Fcoretemp.c;h=78be66176840d1c6abdf29dd632d7a107f6ad2d3;hb=22e04f6b4b04a8afe9af9239224591d06ba3b24d;hp=2e5e2dc47eafdca62ae3513bee1e471cbdb1276d;hpb=04fcec88cdd050ae1cecf7cc7fabf50bd48b8cba;p=~andy%2Flinux diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 2e5e2dc47ea..78be6617684 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -316,6 +316,18 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) return tjmax; } +static bool cpu_has_tjmax(struct cpuinfo_x86 *c) +{ + u8 model = c->x86_model; + + return model > 0xe && + model != 0x1c && + model != 0x26 && + model != 0x27 && + model != 0x35 && + model != 0x36; +} + static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) { int err; @@ -328,7 +340,7 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) */ err = rdmsr_safe_on_cpu(id, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx); if (err) { - if (c->x86_model > 0xe && c->x86_model != 0x1c) + if (cpu_has_tjmax(c)) dev_warn(dev, "Unable to read TjMax from CPU %u\n", id); } else { val = (eax >> 16) & 0xff;