diff options
author | Akshay Bhat <akshay.bhat@timesys.com> | 2017-11-08 14:58:14 -0500 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-11-09 01:16:35 +0100 |
commit | 804a6cfeb5c9e1caae86b345a5a8a50f77ddccc4 (patch) | |
tree | ade4aa4f12ae302baf386a11c5a01720add4a63a /drivers/rtc | |
parent | abf57f73ef0f88f215d35c1418bba0ab7bdee710 (diff) | |
download | linux-804a6cfeb5c9e1caae86b345a5a8a50f77ddccc4.tar.bz2 |
rtc: rx8010: Fix for incorrect return value
The err variable is not being reset after a successful read. Explicitly
return 0 at the end of function call to account for all return paths.
Reported-by: Jens-Peter Oswald <oswald@lre.de>
Signed-off-by: Akshay Bhat <akshay.bhat@timesys.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-rx8010.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-rx8010.c b/drivers/rtc/rtc-rx8010.c index 2e06e5fc4a16..5c5938ab3d86 100644 --- a/drivers/rtc/rtc-rx8010.c +++ b/drivers/rtc/rtc-rx8010.c @@ -247,7 +247,7 @@ static int rx8010_init_client(struct i2c_client *client) rx8010->ctrlreg = (ctrl[1] & ~RX8010_CTRL_TEST); - return err; + return 0; } static int rx8010_read_alarm(struct device *dev, struct rtc_wkalrm *t) @@ -276,7 +276,7 @@ static int rx8010_read_alarm(struct device *dev, struct rtc_wkalrm *t) t->enabled = !!(rx8010->ctrlreg & RX8010_CTRL_AIE); t->pending = (flagreg & RX8010_FLAG_AF) && t->enabled; - return err; + return 0; } static int rx8010_set_alarm(struct device *dev, struct rtc_wkalrm *t) |