clock: remove redundant parameter from the create method.

There is no need for the 'ifaces' parameter since the list of network
interfaces is already present in the configuration.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2015-10-18 22:10:05 +02:00
parent 9b27664cfc
commit bbe55fbea4
3 changed files with 5 additions and 8 deletions

View File

@ -798,8 +798,7 @@ static void clock_remove_port(struct clock *c, struct port *p)
port_close(p);
}
struct clock *clock_create(struct config *config, int phc_index,
struct interfaces_head *ifaces)
struct clock *clock_create(struct config *config, int phc_index)
{
enum timestamp_type timestamping =
config_get_int(config, NULL, "time_stamping");
@ -810,7 +809,7 @@ struct clock *clock_create(struct config *config, int phc_index,
unsigned char oui[OUI_LEN];
char phc[32], *tmp;
struct interface *udsif = &c->uds_interface;
struct interface *iface = STAILQ_FIRST(ifaces);
struct interface *iface = STAILQ_FIRST(&config->interfaces);
struct timespec ts;
int sfl;
@ -1017,7 +1016,7 @@ struct clock *clock_create(struct config *config, int phc_index,
clock_fda_changed(c);
/* Create the ports. */
STAILQ_FOREACH(iface, ifaces, list) {
STAILQ_FOREACH(iface, &config->interfaces, list) {
if (clock_add_port(c, phc_index, timestamping, iface)) {
pr_err("failed to open port %s", iface->name);
return NULL;

View File

@ -71,11 +71,9 @@ struct config *clock_config(struct clock *c);
* @param config Pointer to the configuration database.
* @param phc_index PTP hardware clock device to use.
* Pass -1 to select CLOCK_REALTIME.
* @param ifaces A queue of network interfaces.
* @return A pointer to the single global clock instance.
*/
struct clock *clock_create(struct config *config, int phc_index,
struct interfaces_head *ifaces);
struct clock *clock_create(struct config *config, int phc_index);
/**
* Obtains a clock's default data set.

View File

@ -254,7 +254,7 @@ int main(int argc, char *argv[])
pr_info("selected /dev/ptp%d as PTP clock", phc_index);
}
clock = clock_create(cfg, phc_index, &cfg->interfaces);
clock = clock_create(cfg, phc_index);
if (!clock) {
fprintf(stderr, "failed to create a clock\n");
goto out;