net: ptp: clock: Create a dummy inline func for net_eth_get_ptp_clock()
Follow the style in other similar functions in this file. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
a506aa3dfb
commit
def6b14aa7
2 changed files with 11 additions and 4 deletions
|
@ -671,7 +671,16 @@ int net_eth_promisc_mode(struct net_if *iface, bool enable);
|
||||||
* @return Pointer to PTP clock if found, NULL if not found or if this
|
* @return Pointer to PTP clock if found, NULL if not found or if this
|
||||||
* ethernet interface does not support PTP.
|
* ethernet interface does not support PTP.
|
||||||
*/
|
*/
|
||||||
|
#if defined(CONFIG_PTP_CLOCK)
|
||||||
struct device *net_eth_get_ptp_clock(struct net_if *iface);
|
struct device *net_eth_get_ptp_clock(struct net_if *iface);
|
||||||
|
#else
|
||||||
|
static inline struct device *net_eth_get_ptp_clock(struct net_if *iface)
|
||||||
|
{
|
||||||
|
ARG_UNUSED(iface);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return gPTP port number attached to this interface.
|
* @brief Return gPTP port number attached to this interface.
|
||||||
|
|
|
@ -965,9 +965,9 @@ void net_eth_carrier_off(struct net_if *iface)
|
||||||
handle_carrier(ctx, iface, carrier_off);
|
handle_carrier(ctx, iface, carrier_off);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_PTP_CLOCK)
|
||||||
struct device *net_eth_get_ptp_clock(struct net_if *iface)
|
struct device *net_eth_get_ptp_clock(struct net_if *iface)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_PTP_CLOCK)
|
|
||||||
struct device *dev = net_if_get_device(iface);
|
struct device *dev = net_if_get_device(iface);
|
||||||
const struct ethernet_api *api = dev->driver_api;
|
const struct ethernet_api *api = dev->driver_api;
|
||||||
|
|
||||||
|
@ -984,10 +984,8 @@ struct device *net_eth_get_ptp_clock(struct net_if *iface)
|
||||||
}
|
}
|
||||||
|
|
||||||
return api->get_ptp_clock(net_if_get_device(iface));
|
return api->get_ptp_clock(net_if_get_device(iface));
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_PTP_CLOCK */
|
||||||
|
|
||||||
#if defined(CONFIG_NET_GPTP)
|
#if defined(CONFIG_NET_GPTP)
|
||||||
int net_eth_get_ptp_port(struct net_if *iface)
|
int net_eth_get_ptp_port(struct net_if *iface)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue