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:

committed by
David S. Miller

parent
d270f76c2d
commit
efee95f42b
@@ -334,7 +334,7 @@ void e1000e_ptp_init(struct e1000_adapter *adapter)
|
||||
if (IS_ERR(adapter->ptp_clock)) {
|
||||
adapter->ptp_clock = NULL;
|
||||
e_err("ptp_clock_register failed\n");
|
||||
} else {
|
||||
} else if (adapter->ptp_clock) {
|
||||
e_info("registered PHC clock\n");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user