/* Read registers from device and populate mcp7940n_registers struct.  */
static int read_time(const struct device *dev, time_t *unix_time)
/* Read registers from device and populate mcp7940n_registers struct.  */
static int read_time(const struct device *dev, time_t *unix_time)
{
	struct mcp7940n_data *data = dev->data;
	const struct mcp7940n_config *cfg = dev->config;
	uint8_t addr = REG_RTC_SEC;
	int rc = i2c_write_read_dt(&cfg->i2c, &addr, sizeof(addr), &data->registers,
				   RTC_TIME_REGISTERS_SIZE);
	if (rc >= 0) {
		*unix_time = decode_rtc(dev);
	}
	return rc;
}