summaryrefslogtreecommitdiff
path: root/net/devlink/core.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-01-18 16:21:04 +0100
committerJakub Kicinski <kuba@kernel.org>2023-01-19 19:08:37 -0800
commit5cc9049cb9021a46ad5711a946eb3ded47eed0de (patch)
tree86862153b5fda878179b92693ea43a7761de9b10 /net/devlink/core.c
parent854617f52ab4241896190abac7688eaaf6774451 (diff)
downloadlwn-5cc9049cb9021a46ad5711a946eb3ded47eed0de.tar.gz
lwn-5cc9049cb9021a46ad5711a946eb3ded47eed0de.zip
devlink: remove linecards lock
Similar to other devlink objects, convert the linecards list to be protected by devlink instance lock. Alongside with that rename the create/destroy() functions to devl_* to indicate the devlink instance lock needs to be held while calling them. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/devlink/core.c')
-rw-r--r--net/devlink/core.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/net/devlink/core.c b/net/devlink/core.c
index 60beca2df7cc..dfc5b58c0464 100644
--- a/net/devlink/core.c
+++ b/net/devlink/core.c
@@ -247,7 +247,6 @@ struct devlink *devlink_alloc_ns(const struct devlink_ops *ops,
mutex_init(&devlink->lock);
lockdep_set_class(&devlink->lock, &devlink->lock_key);
mutex_init(&devlink->reporters_lock);
- mutex_init(&devlink->linecards_lock);
refcount_set(&devlink->refcount, 1);
return devlink;
@@ -269,7 +268,6 @@ void devlink_free(struct devlink *devlink)
{
ASSERT_DEVLINK_NOT_REGISTERED(devlink);
- mutex_destroy(&devlink->linecards_lock);
mutex_destroy(&devlink->reporters_lock);
WARN_ON(!list_empty(&devlink->trap_policer_list));
WARN_ON(!list_empty(&devlink->trap_group_list));