mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
devlink: Do not hold devlink mutex when initializing devlink fields
There is no need to hold a device global lock when initializing devlink device fields of a devlink instance which is not yet part of the devices list. Signed-off-by: Parav Pandit <parav@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3fc364c052
commit
6553e561ca
1 changed files with 1 additions and 1 deletions
|
@ -7421,9 +7421,9 @@ EXPORT_SYMBOL_GPL(devlink_alloc);
|
|||
*/
|
||||
int devlink_register(struct devlink *devlink, struct device *dev)
|
||||
{
|
||||
mutex_lock(&devlink_mutex);
|
||||
devlink->dev = dev;
|
||||
devlink->registered = true;
|
||||
mutex_lock(&devlink_mutex);
|
||||
list_add_tail(&devlink->list, &devlink_list);
|
||||
devlink_notify(devlink, DEVLINK_CMD_NEW);
|
||||
mutex_unlock(&devlink_mutex);
|
||||
|
|
Loading…
Reference in a new issue