From a897ffcf7d2f57a3d04a8e3c05c51893041bad87 Mon Sep 17 00:00:00 2001 From: Paul T Date: Wed, 21 May 2025 12:33:29 +0100 Subject: [PATCH] ts2phc: PHC sync logic shall not skip step if set_freq fails Some PHC does not support adjustment by frequency but support by step. Current implementation does not try to apply step after frequency adjustment fails. This commit fixes the logic to try both before goto error handling. --- ts2phc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ts2phc.c b/ts2phc.c index 39d31b64..7e74e8fa 100644 --- a/ts2phc.c +++ b/ts2phc.c @@ -524,10 +524,8 @@ static void ts2phc_synchronize_clocks(struct ts2phc_private *priv, int autocfg) case SERVO_UNLOCKED: break; case SERVO_JUMP: - if (clockadj_set_freq(c->clkid, -adj)) { - goto servo_unlock; - } - if (clockadj_step(c->clkid, -offset)) { + if (0 != clockadj_set_freq(c->clkid, -adj) && + 0 != clockadj_step(c->clkid, -offset)) { goto servo_unlock; } break;