# HG changeset patch # User Josef 'Jeff' Sipek # Date 1726755301 14400 # Thu Sep 19 10:15:01 2024 -0400 # Node ID 06e937c32a4f676879516543c44990dd02b3e0fd # Parent a9aff2cef138fa73aa1108b5303660b4907dc313 # Parent 884fe32b54e7623799ee082d148aa1210f6570c3 Merge branch 'devices' Signed-off-by: Josef 'Jeff' Sipek diff --git a/devices/i2c/mcp7940n.c b/devices/i2c/mcp7940n.c --- a/devices/i2c/mcp7940n.c +++ b/devices/i2c/mcp7940n.c @@ -214,8 +214,9 @@ tmp.month = BIN2BCD(tm->month, 4, 0) & 0x1f; tmp.year = BIN2BCD(tm->year - 2000, 4, 0); + /* update date & time but leave control & trim alone */ if (!mcp7940n_write(offsetof(struct mcp7940n, timekeeping), &tmp, - sizeof(tmp))) + offsetof(struct mcp7940n, timekeeping.control))) return false; /* start the oscillator */