summaryrefslogtreecommitdiffstats
path: root/net/devlink/port.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-09-13 09:12:32 +0200
committerDavid S. Miller <davem@davemloft.net>2023-09-17 15:01:46 +0200
commitd0b7e990f760ec9a614fbe5f89a5cede4335a7bb (patch)
tree79be0d5641cfc5e51444414afc0aeb388691505e /net/devlink/port.c
parentnet: microchip: lan743x: add fixed phy unregister support (diff)
downloadlinux-d0b7e990f760ec9a614fbe5f89a5cede4335a7bb.tar.xz
linux-d0b7e990f760ec9a614fbe5f89a5cede4335a7bb.zip
devlink: move linecard struct into linecard.c
Instead of exposing linecard struct, expose a simple helper to get the linecard index, which is all is needed outside linecard.c. Move the linecard struct to linecard.c and keep it private similar to the rest of the devlink objects. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/devlink/port.c')
-rw-r--r--net/devlink/port.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/devlink/port.c b/net/devlink/port.c
index 4763b42885fb..7b300a322ed9 100644
--- a/net/devlink/port.c
+++ b/net/devlink/port.c
@@ -483,7 +483,7 @@ static int devlink_nl_port_fill(struct sk_buff *msg,
goto nla_put_failure;
if (devlink_port->linecard &&
nla_put_u32(msg, DEVLINK_ATTR_LINECARD_INDEX,
- devlink_port->linecard->index))
+ devlink_linecard_index(devlink_port->linecard)))
goto nla_put_failure;
genlmsg_end(msg, hdr);
@@ -1420,7 +1420,7 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port,
case DEVLINK_PORT_FLAVOUR_PHYSICAL:
if (devlink_port->linecard)
n = snprintf(name, len, "l%u",
- devlink_port->linecard->index);
+ devlink_linecard_index(devlink_port->linecard));
if (n < len)
n += snprintf(name + n, len - n, "p%u",
attrs->phys.port_number);