Take ref clock address from dc_ref_clock pointer.
authorFlorian Pose <fp@igh-essen.com>
Mon, 04 May 2009 12:10:11 +0000
changeset 1435 f1df39224f49
parent 1434 4c6fe0ae37f1
child 1436 08eaf72409bb
Take ref clock address from dc_ref_clock pointer.
master/cdev.c
--- a/master/cdev.c	Mon May 04 10:05:55 2009 +0000
+++ b/master/cdev.c	Mon May 04 12:10:11 2009 +0000
@@ -199,11 +199,8 @@
     up(&master->device_sem);
 
     data.app_time = master->app_time;
-    data.ref_clock = EC_READ_U16(master->sync_datagram.address);
-    if (data.ref_clock < 0xffff) {
-        // ref_clock address is station_address, output ring position
-        data.ref_clock--;
-    }
+    data.ref_clock =
+        master->dc_ref_clock ? master->dc_ref_clock->ring_position : 0xffff;
 
     if (copy_to_user((void __user *) arg, &data, sizeof(data)))
         return -EFAULT;