linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT()
@ 2020-03-03 10:16 Dan Carpenter
  2020-03-03 15:20 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-03-03 10:16 UTC (permalink / raw)
  To: Jean Delvare, Darrick J. Wong; +Cc: Guenter Roeck, linux-hwmon, kernel-janitors

This is only called from adt7462_update_device().  The caller expects it
to return zero on error.  I fixed a similar issue earlier in commit
a4bf06d58f21 ("hwmon: (adt7462) ADT7462_REG_VOLT_MAX() should return 0")
but I missed this one.

Fixes: c0b4e3ab0c76 ("adt7462: new hwmon driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/hwmon/adt7462.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/adt7462.c b/drivers/hwmon/adt7462.c
index 9632e2e3c4bb..319a0519ebdb 100644
--- a/drivers/hwmon/adt7462.c
+++ b/drivers/hwmon/adt7462.c
@@ -413,7 +413,7 @@ static int ADT7462_REG_VOLT(struct adt7462_data *data, int which)
 			return 0x95;
 		break;
 	}
-	return -ENODEV;
+	return 0;
 }
 
 /* Provide labels for sysfs */
-- 
2.11.0


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

* Re: [PATCH] hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT()
  2020-03-03 10:16 [PATCH] hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT() Dan Carpenter
@ 2020-03-03 15:20 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2020-03-03 15:20 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Jean Delvare, Guenter Roeck, linux-hwmon, kernel-janitors

On Tue, Mar 03, 2020 at 01:16:08PM +0300, Dan Carpenter wrote:
> This is only called from adt7462_update_device().  The caller expects it
> to return zero on error.  I fixed a similar issue earlier in commit
> a4bf06d58f21 ("hwmon: (adt7462) ADT7462_REG_VOLT_MAX() should return 0")
> but I missed this one.
> 
> Fixes: c0b4e3ab0c76 ("adt7462: new hwmon driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Looks ok to me (though I no longer have a machine with a 7462 to test),
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  drivers/hwmon/adt7462.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/adt7462.c b/drivers/hwmon/adt7462.c
> index 9632e2e3c4bb..319a0519ebdb 100644
> --- a/drivers/hwmon/adt7462.c
> +++ b/drivers/hwmon/adt7462.c
> @@ -413,7 +413,7 @@ static int ADT7462_REG_VOLT(struct adt7462_data *data, int which)
>  			return 0x95;
>  		break;
>  	}
> -	return -ENODEV;
> +	return 0;
>  }
>  
>  /* Provide labels for sysfs */
> -- 
> 2.11.0
> 

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

end of thread, other threads:[~2020-03-03 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03 10:16 [PATCH] hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT() Dan Carpenter
2020-03-03 15:20 ` Darrick J. Wong

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).