[PATCH 2/7] hwclock command: forward return value of rtc_set_time

Sascha Hauer s.hauer at pengutronix.de
Mon Dec 14 03:43:26 PST 2015


rtc_set_time can fail, forward the error to the user.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 commands/hwclock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/commands/hwclock.c b/commands/hwclock.c
index 49569a9..3f89cce 100644
--- a/commands/hwclock.c
+++ b/commands/hwclock.c
@@ -124,8 +124,7 @@ static int do_hwclock(int argc, char *argv[])
 		return PTR_ERR(r);
 
 	if (set) {
-		rtc_set_time(r, &stm);
-		return 0;
+		return rtc_set_time(r, &stm);
 	}
 
 	rtc_read_time(r, &tm);
-- 
2.6.2




More information about the barebox mailing list