From: Christophe JAILLET Date: Wed, 14 Nov 2018 17:19:51 +0000 (+0100) Subject: rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()' X-Git-Tag: v5.15~7275^2~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41ef3878203cd9218d92eaa07df4b85a2cb128fb;p=platform%2Fkernel%2Flinux-starfive.git rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()' 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 Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c index 08c661a..20e50d9 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)