diff mbox series

hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT()

Message ID 20200303101608.kqjwfcazu2ylhi2a@kili.mountain (mailing list archive)
State Accepted
Headers show
Series hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT() | expand

Commit Message

Dan Carpenter March 3, 2020, 10:16 a.m. UTC
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(-)

Comments

Darrick J. Wong March 3, 2020, 3:20 p.m. UTC | #1
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
>
diff mbox series

Patch

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 */