drivers/net/slip.c: It's enough to only hold the net lock in SLIP driver

This commit is contained in:
Xiang Xiao 2020-02-02 15:24:17 +08:00 committed by Gregory Nutt
parent ca8191ad41
commit 0159726da5
1 changed files with 1 additions and 10 deletions

View File

@ -460,12 +460,6 @@ static int slip_txtask(int argc, FAR char *argv[])
if (priv->bifup)
{
/* Get exclusive access to the network (if it it is already being
* used slip_rxtask, then we have to wait).
*/
slip_semtake(priv);
/* Poll the networking layer for new XMIT data. */
net_lock();
@ -490,7 +484,6 @@ static int slip_txtask(int argc, FAR char *argv[])
}
net_unlock();
slip_semgive(priv);
}
}
@ -705,11 +698,10 @@ static int slip_rxtask(int argc, FAR char *argv[])
/* Handle the IP input. Get exclusive access to the network. */
slip_semtake(priv);
net_lock();
priv->dev.d_buf = priv->rxbuf;
priv->dev.d_len = priv->rxlen;
net_lock();
NETDEV_RXPACKETS(&priv->dev);
/* All packets are assumed to be IP packets (we don't have a choice..
@ -759,7 +751,6 @@ static int slip_rxtask(int argc, FAR char *argv[])
}
net_unlock();
slip_semgive(priv);
}
/* We won't get here */