Skip to content

Commit

Permalink
hwmon: (adm9240) Fix writes into inX_max attributes
Browse files Browse the repository at this point in the history
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: 124b7e3 ("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>
  • Loading branch information
Guenter Roeck committed May 13, 2021
1 parent 8370e5b commit 3b5169c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/adm9240.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3b5169c

Please sign in to comment.