Commit 804a6cfe authored by Akshay Bhat's avatar Akshay Bhat Committed by Alexandre Belloni

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: default avatarJens-Peter Oswald <oswald@lre.de>
Signed-off-by: default avatarAkshay Bhat <akshay.bhat@timesys.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent abf57f73
...@@ -247,7 +247,7 @@ static int rx8010_init_client(struct i2c_client *client) ...@@ -247,7 +247,7 @@ static int rx8010_init_client(struct i2c_client *client)
rx8010->ctrlreg = (ctrl[1] & ~RX8010_CTRL_TEST); rx8010->ctrlreg = (ctrl[1] & ~RX8010_CTRL_TEST);
return err; return 0;
} }
static int rx8010_read_alarm(struct device *dev, struct rtc_wkalrm *t) 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) ...@@ -276,7 +276,7 @@ static int rx8010_read_alarm(struct device *dev, struct rtc_wkalrm *t)
t->enabled = !!(rx8010->ctrlreg & RX8010_CTRL_AIE); t->enabled = !!(rx8010->ctrlreg & RX8010_CTRL_AIE);
t->pending = (flagreg & RX8010_FLAG_AF) && t->enabled; t->pending = (flagreg & RX8010_FLAG_AF) && t->enabled;
return err; return 0;
} }
static int rx8010_set_alarm(struct device *dev, struct rtc_wkalrm *t) static int rx8010_set_alarm(struct device *dev, struct rtc_wkalrm *t)
......
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