]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 14 Nov 2018 17:19:51 +0000 (18:19 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:22:10 +0000 (14:22 -0300)
BugLink: https://bugs.launchpad.net/bugs/1857158
[ Upstream commit 41ef3878203cd9218d92eaa07df4b85a2cb128fb ]

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>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/rtc/rtc-max8997.c

index db984d4bf9526bbc78e501ff8da6a7036801872b..4cce5bd448f65f0cb54259ead69ff008d5a12e54 100644 (file)
@@ -221,7 +221,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)