diff --git a/src/sfptpd_clock.c b/src/sfptpd_clock.c index 03b8fc5a..2dfee86f 100644 --- a/src/sfptpd_clock.c +++ b/src/sfptpd_clock.c @@ -1621,7 +1621,8 @@ int sfptpd_clock_adjust_time(struct sfptpd_clock *clock, struct timespec *offset assert(clock->magic == SFPTPD_CLOCK_MAGIC); assert(offset != NULL); - if (clock->u.nic.phc == NULL) { + if (clock->type != SFPTPD_CLOCK_TYPE_SYSTEM && + clock->u.nic.phc == NULL) { ERROR("clock %s: unable to step clock - no phc device\n", clock->long_name); rc = ENODEV; @@ -1683,7 +1684,8 @@ int sfptpd_clock_adjust_frequency(struct sfptpd_clock *clock, long double freq_a assert(clock != NULL); assert(clock->magic == SFPTPD_CLOCK_MAGIC); - if (clock->u.nic.phc == NULL) { + if (clock->type != SFPTPD_CLOCK_TYPE_SYSTEM && + clock->u.nic.phc == NULL) { ERROR("clock %s: unable to adjust frequency - no phc device\n", clock->long_name); rc = ENODEV; @@ -1877,7 +1879,8 @@ int sfptpd_clock_get_time(const struct sfptpd_clock *clock, struct timespec *tim assert(clock->magic == SFPTPD_CLOCK_MAGIC); assert(time != NULL); - if (clock->u.nic.phc == NULL) { + if (clock->type != SFPTPD_CLOCK_TYPE_SYSTEM && + clock->u.nic.phc == NULL) { ERROR("clock %s: unable to get time - no phc device\n", clock->long_name); rc = ENODEV; diff --git a/src/sfptpd_phc.c b/src/sfptpd_phc.c index 0a486de9..c0e3086c 100644 --- a/src/sfptpd_phc.c +++ b/src/sfptpd_phc.c @@ -341,7 +341,7 @@ static int phc_configure_pps(struct sfptpd_phc *phc) if (ioctl(phc->phc_fd, PTP_ENABLE_PPS, 1) != 0) { ERROR("phc%d: failed to enable PPS events, %s\n", - phc->phc_fd, strerror(errno)); + phc->phc_idx, strerror(errno)); rc = errno; goto fail2; }