Skip to content

Commit

Permalink
Convert call sites to the proper method for testing time stamp info v…
Browse files Browse the repository at this point in the history
…alidity.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
  • Loading branch information
richardcochran committed Mar 4, 2020
1 parent 3d388e1 commit 605abc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions port.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 605abc4

Please sign in to comment.