From 645a228481c778b62fcd6c23e6f4786ceb8f1300 Mon Sep 17 00:00:00 2001 From: Dmitry Salychev Date: Mon, 3 Jun 2024 15:41:11 +0200 Subject: [PATCH] ds1307: Return error code instead of boolean 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 --- sys/dev/iicbus/rtc/ds1307.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/iicbus/rtc/ds1307.c b/sys/dev/iicbus/rtc/ds1307.c index e8aa6a258ed..67a753bb3ed 100644 --- a/sys/dev/iicbus/rtc/ds1307.c +++ b/sys/dev/iicbus/rtc/ds1307.c @@ -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); @@ -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)