Skip to content

Commit

Permalink
ds1307: Return error code instead of boolean
Browse files Browse the repository at this point in the history
It's probably a copy-paste leftover from the other functions which
return a boolean value and generates annoying "CLOCK_SETTIME error 1"
from subr_rtc.c on Traverse Ten64 in verbose mode.

No functional changes intended.

MFC after:	3 days
  • Loading branch information
Dmitry Salychev authored and Dmitry Salychev committed Jun 3, 2024
1 parent 0f996f4 commit 645a228
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sys/dev/iicbus/rtc/ds1307.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ mark_epson_time_valid(struct ds1307_softc *sc)
if (error) {
device_printf(dev, "%s cannot read Control 2 register: %d\n",
__func__, error);
return (false);
return (error);
}

control_mask = (RX8035_CTRL_2_PON | RX8035_CTRL_2_XSTP | RX8035_CTRL_2_VDET);
Expand All @@ -356,9 +356,9 @@ mark_epson_time_valid(struct ds1307_softc *sc)
if (error) {
device_printf(dev, "%s cannot write to Control 2 register: %d\n",
__func__, error);
return (false);
return (error);
}
return (true);
return (0);
}

static bool is_dev_time_valid(struct ds1307_softc *sc)
Expand Down

0 comments on commit 645a228

Please sign in to comment.