clock: Remove cruft from the creation method.
The time stamping setup code needlessly queries the configuration data base over and over, rather than simply using the local variable already assigned. This patch replaces the extraneous config_get_int() calls with the local variable. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
86ed2432f0
commit
1de59d6226
7
clock.c
7
clock.c
|
@ -891,7 +891,7 @@ struct clock *clock_create(enum clock_type type, struct config *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(c->dds.flags & DDS_TWO_STEP_FLAG)) {
|
if (!(c->dds.flags & DDS_TWO_STEP_FLAG)) {
|
||||||
switch (config_get_int(config, NULL, "time_stamping")) {
|
switch (timestamping) {
|
||||||
case TS_SOFTWARE:
|
case TS_SOFTWARE:
|
||||||
case TS_LEGACY_HW:
|
case TS_LEGACY_HW:
|
||||||
pr_err("one step is only possible "
|
pr_err("one step is only possible "
|
||||||
|
@ -908,7 +908,7 @@ struct clock *clock_create(enum clock_type type, struct config *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check the time stamping mode on each interface. */
|
/* Check the time stamping mode on each interface. */
|
||||||
switch (config_get_int(config, NULL, "time_stamping")) {
|
switch (timestamping) {
|
||||||
case TS_SOFTWARE:
|
case TS_SOFTWARE:
|
||||||
required_modes |= SOF_TIMESTAMPING_TX_SOFTWARE |
|
required_modes |= SOF_TIMESTAMPING_TX_SOFTWARE |
|
||||||
SOF_TIMESTAMPING_RX_SOFTWARE |
|
SOF_TIMESTAMPING_RX_SOFTWARE |
|
||||||
|
@ -940,8 +940,7 @@ struct clock *clock_create(enum clock_type type, struct config *config,
|
||||||
/* determine PHC Clock index */
|
/* determine PHC Clock index */
|
||||||
if (config_get_int(config, NULL, "free_running")) {
|
if (config_get_int(config, NULL, "free_running")) {
|
||||||
phc_index = -1;
|
phc_index = -1;
|
||||||
} else if (config_get_int(config, NULL, "time_stamping") == TS_SOFTWARE ||
|
} else if (timestamping == TS_SOFTWARE || timestamping == TS_LEGACY_HW) {
|
||||||
config_get_int(config, NULL, "time_stamping") == TS_LEGACY_HW) {
|
|
||||||
phc_index = -1;
|
phc_index = -1;
|
||||||
} else if (phc_device) {
|
} else if (phc_device) {
|
||||||
if (1 != sscanf(phc_device, "/dev/ptp%d", &phc_index)) {
|
if (1 != sscanf(phc_device, "/dev/ptp%d", &phc_index)) {
|
||||||
|
|
Loading…
Reference in New Issue