Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ptp: Add a method for obtaining the device index.

This commit adds a method that MAC drivers may call in order to find out
the device number of their associated PTP Hardware Clock.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Richard Cochran and committed by
David S. Miller
995a9090 2173bff5

+14
+6
drivers/ptp/ptp_clock.c
··· 304 304 } 305 305 EXPORT_SYMBOL(ptp_clock_event); 306 306 307 + int ptp_clock_index(struct ptp_clock *ptp) 308 + { 309 + return ptp->index; 310 + } 311 + EXPORT_SYMBOL(ptp_clock_index); 312 + 307 313 /* module operations */ 308 314 309 315 static void __exit ptp_exit(void)
+8
include/linux/ptp_clock_kernel.h
··· 136 136 extern void ptp_clock_event(struct ptp_clock *ptp, 137 137 struct ptp_clock_event *event); 138 138 139 + /** 140 + * ptp_clock_index() - obtain the device index of a PTP clock 141 + * 142 + * @ptp: The clock obtained from ptp_clock_register(). 143 + */ 144 + 145 + extern int ptp_clock_index(struct ptp_clock *ptp); 146 + 139 147 #endif