[v2] rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()'
diff mbox series

Message ID 20181114171951.4137-1-christophe.jaillet@wanadoo.fr
State Accepted
Commit 41ef3878203cd9218d92eaa07df4b85a2cb128fb
Headers show
Series
  • [v2] rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()'
Related show

Commit Message

Christophe JAILLET Nov. 14, 2018, 5:19 p.m. UTC
In case of error, we return 0.
This is spurious and not consistent with the other functions of the driver.
Propagate the error code instead.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
v2: re-word changelog and remove Fixes tag.
   (not sure if any should be provided, and which one would be the best)
---
 drivers/rtc/rtc-max8997.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexandre Belloni Nov. 22, 2018, 5:12 p.m. UTC | #1
On 14/11/2018 18:19:51+0100, Christophe JAILLET wrote:
> In case of error, we return 0.
> This is spurious and not consistent with the other functions of the driver.
> Propagate the error code instead.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> v2: re-word changelog and remove Fixes tag.
>    (not sure if any should be provided, and which one would be the best)
> ---
>  drivers/rtc/rtc-max8997.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
Applied, thanks.

Patch
diff mbox series

diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
index 08c661a332ec..20e50d9fdf88 100644
--- a/drivers/rtc/rtc-max8997.c
+++ b/drivers/rtc/rtc-max8997.c
@@ -215,7 +215,7 @@  static int max8997_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
 
 out:
 	mutex_unlock(&info->lock);
-	return 0;
+	return ret;
 }
 
 static int max8997_rtc_stop_alarm(struct max8997_rtc_info *info)