From 605abc45dd63dc0dbf37fd6096267d1e8bdc144c Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Sun, 9 Feb 2020 15:50:03 -0800 Subject: [PATCH] Convert call sites to the proper method for testing time stamp info validity. Signed-off-by: Richard Cochran Reviewed-by: Jacob Keller --- clock.c | 4 ++-- port.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clock.c b/clock.c index 71b3899..845e27a 100644 --- a/clock.c +++ b/clock.c @@ -956,7 +956,7 @@ struct clock *clock_create(enum clock_type type, struct config *config, interface_set_label(iface, ts_label); interface_ensure_tslabel(iface); interface_get_tsinfo(iface); - if (iface->ts_info.valid && + if (interface_tsinfo_valid(iface) && ((iface->ts_info.so_timestamping & required_modes) != required_modes)) { pr_err("interface '%s' does not support requested timestamping mode", interface_name(iface)); @@ -975,7 +975,7 @@ struct clock *clock_create(enum clock_type type, struct config *config, if (1 != sscanf(phc_device, "/dev/ptp%d", &phc_index)) { phc_index = -1; } - } else if (iface->ts_info.valid) { + } else if (interface_tsinfo_valid(iface)) { phc_index = interface_phc_index(iface); } else { pr_err("PTP device not specified and automatic determination" diff --git a/port.c b/port.c index f4834ba..b590024 100644 --- a/port.c +++ b/port.c @@ -2511,7 +2511,7 @@ void port_link_status(void *ctx, int linkup, int ts_index) interface_get_tsinfo(p->iface); /* Only switch phc with HW time stamping mode */ - if (p->iface->ts_info.valid && + if (interface_tsinfo_valid(p->iface) && interface_phc_index(p->iface) >= 0) { required_modes = clock_required_modes(p->clock); if ((p->iface->ts_info.so_timestamping & required_modes) != required_modes) { @@ -3001,7 +3001,7 @@ struct port *port_open(const char *phc_device, if (transport == TRANS_UDS) { ; /* UDS cannot have a PHC. */ - } else if (!interface->ts_info.valid) { + } else if (!interface_tsinfo_valid(interface)) { pr_warning("port %d: get_ts_info not supported", number); } else if (phc_index >= 0 && phc_index != interface_phc_index(interface)) {