phc2sys: Drop devices with identical PHC clock

With two source interfaces phc2sys will be do nothing and wait. This can
be avoided by skipping iterfaces with identical PHC device since they
will report the same data.

Skip an interface if it uses the same PHC device as the current source.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
diff --git a/phc2sys.c b/phc2sys.c
index 1269d18..27f10f6 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -472,6 +472,13 @@
 			src_cnt++;
 			break;
 		case PS_SLAVE:
+			if (src) {
+				if (c->phc_index == src->phc_index) {
+					pr_info("Skipping %s, uses same clock as %s",
+						c->device, src->device);
+					continue;
+				}
+			}
 			src = c;
 			src_cnt++;
 			break;