diff options
author | Leon Romanovsky <leonro@nvidia.com> | 2021-10-12 16:15:22 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-12 16:29:16 -0700 |
commit | 2bc50987dc1f467551f2ca537239016915256f6d (patch) | |
tree | c39e41c60af4b5ea1e1cace769057ca371ab98a7 /include | |
parent | 21314638c9f251bb40c8ad3b4e1c232057789b8b (diff) | |
download | linux-stable-2bc50987dc1f467551f2ca537239016915256f6d.tar.gz linux-stable-2bc50987dc1f467551f2ca537239016915256f6d.tar.bz2 linux-stable-2bc50987dc1f467551f2ca537239016915256f6d.zip |
devlink: Move netdev_to_devlink helpers to devlink.c
Both netdev_to_devlink and netdev_to_devlink_port are used in devlink.c
only, so move them in order to reduce their scope.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/devlink.h | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h index ae03eb1c6cc9..7f44ad14e5ed 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -1486,23 +1486,6 @@ void *devlink_priv(struct devlink *devlink); struct devlink *priv_to_devlink(void *priv); struct device *devlink_to_dev(const struct devlink *devlink); -static inline struct devlink_port * -netdev_to_devlink_port(struct net_device *dev) -{ - if (dev->netdev_ops->ndo_get_devlink_port) - return dev->netdev_ops->ndo_get_devlink_port(dev); - return NULL; -} - -static inline struct devlink *netdev_to_devlink(struct net_device *dev) -{ - struct devlink_port *devlink_port = netdev_to_devlink_port(dev); - - if (devlink_port) - return devlink_port->devlink; - return NULL; -} - struct ib_device; struct net *devlink_net(const struct devlink *devlink); |