Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (adm9240) Fix writes into inX_max attributes

When converting the driver to use the devm_hwmon_device_register_with_info
API, the wrong register was selected when writing into inX_max attributes.
Fix it.

Fixes: 124b7e34a5a6 ("hwmon: (adm9240) Convert to devm_hwmon_device_register_with_info API")
Reported-by: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

+1 -1
+1 -1
drivers/hwmon/adm9240.c
··· 485 485 reg = ADM9240_REG_IN_MIN(channel); 486 486 break; 487 487 case hwmon_in_max: 488 - reg = ADM9240_REG_IN(channel); 488 + reg = ADM9240_REG_IN_MAX(channel); 489 489 break; 490 490 default: 491 491 return -EOPNOTSUPP;