diff options
author | Xabier Marquiegui <reibax@gmail.com> | 2023-10-12 00:39:54 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-10-15 21:07:52 +0200 |
commit | d26ab5a35ad9920940a9e07665130d501b2ae1a3 (patch) | |
tree | ed55561086f7c6f05dde1c40235ad3eea3cecfa5 /drivers/ptp/ptp_sysfs.c | |
parent | posix-clock: introduce posix_clock_context concept (diff) | |
download | linux-d26ab5a35ad9920940a9e07665130d501b2ae1a3.tar.xz linux-d26ab5a35ad9920940a9e07665130d501b2ae1a3.zip |
ptp: Replace timestamp event queue with linked list
Introduce linked lists to access the timestamp event queue.
Signed-off-by: Xabier Marquiegui <reibax@gmail.com>
Suggested-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ptp/ptp_sysfs.c')
-rw-r--r-- | drivers/ptp/ptp_sysfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c index 6e4d5456a885..2675f383cd0a 100644 --- a/drivers/ptp/ptp_sysfs.c +++ b/drivers/ptp/ptp_sysfs.c @@ -75,12 +75,16 @@ static ssize_t extts_fifo_show(struct device *dev, struct device_attribute *attr, char *page) { struct ptp_clock *ptp = dev_get_drvdata(dev); - struct timestamp_event_queue *queue = &ptp->tsevq; + struct timestamp_event_queue *queue; struct ptp_extts_event event; unsigned long flags; size_t qcnt; int cnt = 0; + /* The sysfs fifo will always draw from the fist queue */ + queue = list_first_entry(&ptp->tsevqs, struct timestamp_event_queue, + qlist); + memset(&event, 0, sizeof(event)); if (mutex_lock_interruptible(&ptp->tsevq_mux)) |