summaryrefslogtreecommitdiff
path: root/drivers/ptp/ptp_sysfs.c
diff options
context:
space:
mode:
authorXabier Marquiegui <reibax@gmail.com>2023-10-12 00:39:54 +0200
committerDavid S. Miller <davem@davemloft.net>2023-10-15 20:07:52 +0100
commitd26ab5a35ad9920940a9e07665130d501b2ae1a3 (patch)
treeed55561086f7c6f05dde1c40235ad3eea3cecfa5 /drivers/ptp/ptp_sysfs.c
parent60c6946675fc06dd2fd2b7a4b6fd1c1f046f1056 (diff)
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.c6
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))