Skip to content
Permalink
Browse files

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>
  • Loading branch information...
jukkar committed May 27, 2019
1 parent a506aa3 commit def6b14aa73a4db56f8ae851eed8627d20de0499
Showing with 11 additions and 4 deletions.
  1. +9 −0 include/net/ethernet.h
  2. +2 −4 subsys/net/l2/ethernet/ethernet.c
@@ -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
* ethernet interface does not support PTP.
*/
#if defined(CONFIG_PTP_CLOCK)
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.
@@ -965,9 +965,9 @@ void net_eth_carrier_off(struct net_if *iface)
handle_carrier(ctx, iface, carrier_off);
}

#if defined(CONFIG_PTP_CLOCK)
struct device *net_eth_get_ptp_clock(struct net_if *iface)
{
#if defined(CONFIG_PTP_CLOCK)
struct device *dev = net_if_get_device(iface);
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));
#else
return NULL;
#endif
}
#endif /* CONFIG_PTP_CLOCK */

#if defined(CONFIG_NET_GPTP)
int net_eth_get_ptp_port(struct net_if *iface)

0 comments on commit def6b14

Please sign in to comment.
You can’t perform that action at this time.