Skip to content

Commit

Permalink
drivers/rtc/rtc-twl.c: check return value of twl_rtc_write_u8() in tw…
Browse files Browse the repository at this point in the history
…l_rtc_set_time()

We forget to save the return value of the call to
twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG); in 'ret', making the
test of 'ret < 0' dead code since 'ret' then couldn't possibly have
changed since the last test just a few lines above.  It also makes us not
detect failures from that specific twl_rtc_write_u8() call.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Rusev <source@mvista.com>
Cc: "George G. Davis" <gdavis@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jesper Juhl authored and Linus Torvalds committed Jul 26, 2011
1 parent 9a9a54a commit 8f6b0dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-twl.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ static int twl_rtc_set_time(struct device *dev, struct rtc_time *tm)
goto out;

save_control &= ~BIT_RTC_CTRL_REG_STOP_RTC_M;
twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
ret = twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG);
if (ret < 0)
goto out;

Expand Down

0 comments on commit 8f6b0dd

Please sign in to comment.