Commit 742e800b authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Kleber Sacilotto de Souza

rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()'

BugLink: https://bugs.launchpad.net/bugs/1858489

[ Upstream commit 41ef3878 ]

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 676dd928
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment