hwmon: (adm9240) Fix writes into inX_max attributes
Guenter Roeck
maintainerPATCH 1/1 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 <[email protected]>
Signed-off-by Guenter Roeck <[email protected]>
--- drivers/hwmon/adm9240.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/adm9240.c +1 -1
@@ -485,7 +485,7 @@ static int adm9240_in_write(struct device *dev, u32 attr, int channel, long val) reg =ADM9240_REG_IN_MIN (channel);break ;case hwmon_in_max: - reg =ADM9240_REG_IN (channel); + reg =ADM9240_REG_IN_MAX (channel);break ;default :return -EOPNOTSUPP ;
Signature · 1 line
2.25.1
Quoted 7 lines · Guenter Roeck
When converting the driver to use the
devm_hwmon_device_register_with_infoAPI, the wrong register was selected when writing intoinX_maxattributes. Fix it.Fixes 124b7e34a5a6 ("hwmon: (adm9240) Convert to devm_hwmon_device_register_with_info API")Reported-by Chris Packham <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
Works for me.
Tested-by Chris Packham <[email protected]>
Quoted 17 lines
--- drivers/hwmon/adm9240.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwmon/adm9240.c +1
-1@@ -485,7 +485,7 @@ static int adm9240_in_write(struct device *dev, u32 attr, int channel, long val) reg =ADM9240_REG_IN_MIN (channel);break ;case hwmon_in_max: - reg =ADM9240_REG_IN (channel); + reg =ADM9240_REG_IN_MAX (channel);break ;default :return -EOPNOTSUPP ;