Do not expect or open a /dev/ptpX device when in free_running mode
Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>master
parent
6c54c31dca
commit
1e6a169431
4
clock.c
4
clock.c
|
@ -402,7 +402,9 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count,
|
||||||
if (c->nports)
|
if (c->nports)
|
||||||
clock_destroy(c);
|
clock_destroy(c);
|
||||||
|
|
||||||
if (phc_index >= 0) {
|
if (c->dds.free_running) {
|
||||||
|
c->clkid = CLOCK_INVALID;
|
||||||
|
} else if (phc_index >= 0) {
|
||||||
snprintf(phc, 31, "/dev/ptp%d", phc_index);
|
snprintf(phc, 31, "/dev/ptp%d", phc_index);
|
||||||
c->clkid = phc_open(phc);
|
c->clkid = phc_open(phc);
|
||||||
if (c->clkid == CLOCK_INVALID) {
|
if (c->clkid == CLOCK_INVALID) {
|
||||||
|
|
4
ptp4l.c
4
ptp4l.c
|
@ -247,7 +247,9 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
/* determine PHC Clock index */
|
/* determine PHC Clock index */
|
||||||
if (*timestamping == TS_SOFTWARE || *timestamping == TS_LEGACY_HW) {
|
if (ds->free_running) {
|
||||||
|
phc_index = -1;
|
||||||
|
} else if (*timestamping == TS_SOFTWARE || *timestamping == TS_LEGACY_HW) {
|
||||||
phc_index = -1;
|
phc_index = -1;
|
||||||
} else if (req_phc) {
|
} else if (req_phc) {
|
||||||
if (1 != sscanf(req_phc, "/dev/ptp%d", &phc_index)) {
|
if (1 != sscanf(req_phc, "/dev/ptp%d", &phc_index)) {
|
||||||
|
|
Loading…
Reference in New Issue