ptp_clock: future-proofing drivers against PTP subsystem becoming optional
Drivers must be ready to accept NULL from ptp_clock_register() if the PTP clock subsystem is configured out. This patch documents that and ensures that all drivers cope well with a NULL return. Signed-off-by: Nicolas Pitre <nico@linaro.org> Reviewed-by: Eugenia Emantayev <eugenia@mellanox.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Acked-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d270f76c2d
commit
efee95f42b
9 changed files with 19 additions and 14 deletions
|
@ -127,6 +127,11 @@ struct ptp_clock;
|
|||
*
|
||||
* @info: Structure describing the new clock.
|
||||
* @parent: Pointer to the parent device of the new clock.
|
||||
*
|
||||
* Returns a valid pointer on success or PTR_ERR on failure. If PHC
|
||||
* support is missing at the configuration level, this function
|
||||
* returns NULL, and drivers are expected to gracefully handle that
|
||||
* case separately.
|
||||
*/
|
||||
|
||||
extern struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue