summaryrefslogtreecommitdiff
path: root/net/devlink/linecard.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-09-13 09:12:36 +0200
committerDavid S. Miller <davem@davemloft.net>2023-09-17 14:01:46 +0100
commitaf1f1400af02e5a069d86ae7001b563c99395ea2 (patch)
tree67a2ce36ffd2171608fe86e81b00b2df131ebc2a /net/devlink/linecard.c
parentad99637ac92dc18b979e6fa26eb440f38c0c6b55 (diff)
devlink: move devlink_nl_put_nested_handle() into netlink.c
As the next patch is going to call this helper out of the linecard.c, move to netlink.c. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/devlink/linecard.c')
-rw-r--r--net/devlink/linecard.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/net/devlink/linecard.c b/net/devlink/linecard.c
index f95abdc93c66..688e89daee6a 100644
--- a/net/devlink/linecard.c
+++ b/net/devlink/linecard.c
@@ -65,32 +65,6 @@ devlink_linecard_get_from_info(struct devlink *devlink, struct genl_info *info)
return devlink_linecard_get_from_attrs(devlink, info->attrs);
}
-static int devlink_nl_put_nested_handle(struct sk_buff *msg, struct net *net,
- struct devlink *devlink)
-{
- struct nlattr *nested_attr;
-
- nested_attr = nla_nest_start(msg, DEVLINK_ATTR_NESTED_DEVLINK);
- if (!nested_attr)
- return -EMSGSIZE;
- if (devlink_nl_put_handle(msg, devlink))
- goto nla_put_failure;
- if (!net_eq(net, devlink_net(devlink))) {
- int id = peernet2id_alloc(net, devlink_net(devlink),
- GFP_KERNEL);
-
- if (nla_put_s32(msg, DEVLINK_ATTR_NETNS_ID, id))
- return -EMSGSIZE;
- }
-
- nla_nest_end(msg, nested_attr);
- return 0;
-
-nla_put_failure:
- nla_nest_cancel(msg, nested_attr);
- return -EMSGSIZE;
-}
-
struct devlink_linecard_type {
const char *type;
const void *priv;