Couple of hwmon bug fixes

Update k8temp documentation URL
 Register address fixes in nct6775 driver
 Fix potential division by zero in occ driver
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJdOehsAAoJEMsfJm/On5mBpEUP/i2h/flOszOiS6brH7Ae8POp
 njk+2xc/mP8h6B44QRSLqOA/PUBK7eFRB1iK/dVac7k1u2P3iQTzRc+Fs19S3s7H
 xGFn1czEHSi3OITf1uoVlQBlp7rX1LtoDrPoH4zC+5xmfcVSALpFBxp/onmnpdvr
 XaeYilVa6zotP+dpdQGw3LXMk8Mp29D6f5SD/VIyql7mFY8zS7BV1OmwwAk8pEFo
 e3WSMqkABIJbHrmuxvYAyz0XnzKonV8Bu08RkcuJh8bpPUF5a0fkma1OSXVVUT95
 Y8iIdgW1KRi8vfNK+kpebPYR63uupvYXaH2Dvy4zwlNCH85hXxKiW73L3hDO9QCD
 bB05rlLbCaeRe8wzt+k5g7vWbRlIOr4bp+8JUKGS0cCB61PeCg/Ck6PKEdntG0rU
 /7DbY12H+Cv0Bful65+IHdIp9k/yMZ2SAPFBtIDvNf0EjVcFdHmJquTtHp1mqgk6
 GI1LhGQq4YA+CAze33rf0veMWVEDMTLP2q6rRN8IQJk4x9O8ikER58DRtjqFSbQB
 SRDqgeskgs+kgUAOlYtSwMJRtQSyOPkajfqw0ceCSrJFKZJ3c8RQwQZedl0XOui0
 g9wmMcls0SYgj9Wa2ZGuGYqIjvFzDUYoY+qimoGimb2UTo0kiRG5g/NEFLegdFVH
 d8C9a5BifO/VmRVa9Vx8
 =yoNz
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-v5.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:
 "A couple of hwmon bug fixes:

   - Update k8temp documentation URL

   - Register address fixes in nct6775 driver

   - Fix potential division by zero in occ driver"

* tag 'hwmon-for-v5.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (k8temp) documentation: update URL of datasheet
  hwmon: (nct6775) Fix register address and added missed tolerance for nct6106
  hwmon: (occ) Fix division by zero issue
This commit is contained in:
Linus Torvalds 2019-07-26 09:36:01 -07:00
commit 6108cd475c
3 changed files with 7 additions and 4 deletions

View File

@ -9,7 +9,7 @@ Supported chips:
Addresses scanned: PCI space
Datasheet: http://support.amd.com/us/Processor_TechDocs/32559.pdf
Datasheet: http://www.amd.com/system/files/TechDocs/32559.pdf
Author: Rudolf Marek

View File

@ -852,7 +852,7 @@ static const u16 NCT6106_REG_TARGET[] = { 0x111, 0x121, 0x131 };
static const u16 NCT6106_REG_WEIGHT_TEMP_SEL[] = { 0x168, 0x178, 0x188 };
static const u16 NCT6106_REG_WEIGHT_TEMP_STEP[] = { 0x169, 0x179, 0x189 };
static const u16 NCT6106_REG_WEIGHT_TEMP_STEP_TOL[] = { 0x16a, 0x17a, 0x18a };
static const u16 NCT6106_REG_WEIGHT_DUTY_STEP[] = { 0x16b, 0x17b, 0x17c };
static const u16 NCT6106_REG_WEIGHT_DUTY_STEP[] = { 0x16b, 0x17b, 0x18b };
static const u16 NCT6106_REG_WEIGHT_TEMP_BASE[] = { 0x16c, 0x17c, 0x18c };
static const u16 NCT6106_REG_WEIGHT_DUTY_BASE[] = { 0x16d, 0x17d, 0x18d };
@ -3764,6 +3764,7 @@ static int nct6775_probe(struct platform_device *pdev)
data->REG_FAN_TIME[0] = NCT6106_REG_FAN_STOP_TIME;
data->REG_FAN_TIME[1] = NCT6106_REG_FAN_STEP_UP_TIME;
data->REG_FAN_TIME[2] = NCT6106_REG_FAN_STEP_DOWN_TIME;
data->REG_TOLERANCE_H = NCT6106_REG_TOLERANCE_H;
data->REG_PWM[0] = NCT6106_REG_PWM;
data->REG_PWM[1] = NCT6106_REG_FAN_START_OUTPUT;
data->REG_PWM[2] = NCT6106_REG_FAN_STOP_OUTPUT;

View File

@ -408,8 +408,10 @@ static ssize_t occ_show_power_1(struct device *dev,
static u64 occ_get_powr_avg(u64 *accum, u32 *samples)
{
return div64_u64(get_unaligned_be64(accum) * 1000000ULL,
get_unaligned_be32(samples));
u64 divisor = get_unaligned_be32(samples);
return (divisor == 0) ? 0 :
div64_u64(get_unaligned_be64(accum) * 1000000ULL, divisor);
}
static ssize_t occ_show_power_2(struct device *dev,