summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2022-01-06 02:11:13 +0300
committerDavid S. Miller <davem@davemloft.net>2022-01-06 14:59:09 +0300
commite31dbd3b6aba585231cd84a87adeb22e7c6a8c19 (patch)
treefdc506a5d98febdbedc0a7addabda2cfd3ac3501 /net
parent904e112ad431492b34f235f59738e8312802bbf9 (diff)
downloadlinux-e31dbd3b6aba585231cd84a87adeb22e7c6a8c19.tar.xz
net: dsa: merge rtnl_lock sections in dsa_slave_create
Currently dsa_slave_create() has two sequences of rtnl_lock/rtnl_unlock in a row. Remove the rtnl_unlock() and rtnl_lock() in between, such that the operation can execute slighly faster. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/dsa/slave.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 88bcdba92fa7..22241afcac81 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -2022,14 +2022,12 @@ int dsa_slave_create(struct dsa_port *port)
}
rtnl_lock();
+
ret = dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN);
- rtnl_unlock();
if (ret && ret != -EOPNOTSUPP)
dev_warn(ds->dev, "nonfatal error %d setting MTU to %d on port %d\n",
ret, ETH_DATA_LEN, port->index);
- rtnl_lock();
-
ret = register_netdevice(slave_dev);
if (ret) {
netdev_err(master, "error %d registering interface %s\n",