diff options
author | Jiri Pirko <jiri@nvidia.com> | 2022-11-02 17:02:09 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-11-03 20:48:36 -0700 |
commit | 8eba37f7e9bc82fac08f31d318e36f341494442d (patch) | |
tree | 2c94d5fb46fea7196bd281dbc2a0e1e2f9a4a30b /net/ethtool | |
parent | e705a621c071b43e4ea971abb70d7677dc640c27 (diff) | |
download | linux-8eba37f7e9bc82fac08f31d318e36f341494442d.tar.bz2 |
net: devlink: use devlink_port pointer instead of ndo_get_devlink_port
Use newly introduced devlink_port pointer instead of getting it calling
to ndo_get_devlink_port op.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ethtool')
-rw-r--r-- | net/ethtool/ioctl.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index 57e7238a4136..b6835136c53f 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -44,16 +44,9 @@ struct ethtool_devlink_compat { static struct devlink *netdev_to_devlink_get(struct net_device *dev) { - struct devlink_port *devlink_port; - - if (!dev->netdev_ops->ndo_get_devlink_port) - return NULL; - - devlink_port = dev->netdev_ops->ndo_get_devlink_port(dev); - if (!devlink_port) + if (!dev->devlink_port) return NULL; - - return devlink_try_get(devlink_port->devlink); + return devlink_try_get(dev->devlink_port->devlink); } /* |