linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: (adm9240) Fix writes into inX_max attributes
@ 2021-05-12 23:33 Guenter Roeck
  2021-05-12 23:57 ` Chris Packham
  0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2021-05-12 23:33 UTC (permalink / raw)
  To: Hardware Monitoring; +Cc: Jean Delvare, Guenter Roeck, Chris Packham

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>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/hwmon/adm9240.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index 5677263bcf0d..483cd757abd3 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwmon: (adm9240) Fix writes into inX_max attributes
  2021-05-12 23:33 [PATCH] hwmon: (adm9240) Fix writes into inX_max attributes Guenter Roeck
@ 2021-05-12 23:57 ` Chris Packham
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Packham @ 2021-05-12 23:57 UTC (permalink / raw)
  To: Guenter Roeck, Hardware Monitoring; +Cc: Jean Delvare


On 13/05/21 11:33 am, Guenter Roeck wrote:
> 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>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Works for me.

Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

> ---
>   drivers/hwmon/adm9240.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
> index 5677263bcf0d..483cd757abd3 100644
> --- a/drivers/hwmon/adm9240.c
> +++ b/drivers/hwmon/adm9240.c
> @@ -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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-13  0:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 23:33 [PATCH] hwmon: (adm9240) Fix writes into inX_max attributes Guenter Roeck
2021-05-12 23:57 ` Chris Packham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).