* [PATCH v2] rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()'
@ 2018-11-14 17:19 Christophe JAILLET
2018-11-22 17:12 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2018-11-14 17:19 UTC (permalink / raw)
To: a.zummo, alexandre.belloni
Cc: linux-rtc, linux-kernel, kernel-janitors, Christophe JAILLET
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(-)
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)
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()'
2018-11-14 17:19 [PATCH v2] rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()' Christophe JAILLET
@ 2018-11-22 17:12 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2018-11-22 17:12 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: a.zummo, linux-rtc, linux-kernel, kernel-janitors
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.
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-22 17:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 17:19 [PATCH v2] rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()' Christophe JAILLET
2018-11-22 17:12 ` Alexandre Belloni
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).