Commit 219ad6c1 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: remove defensive checks around ndo_open()/ndo_close()

Device open and close handlers check if the device is already
in the desired state.  Thanks to our reconfig infrastructure
this should not be necessary, there doesn't seem to be any
code in the driver which depends on it.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 28b0cfee
...@@ -2233,11 +2233,6 @@ static int nfp_net_netdev_open(struct net_device *netdev) ...@@ -2233,11 +2233,6 @@ static int nfp_net_netdev_open(struct net_device *netdev)
struct nfp_net *nn = netdev_priv(netdev); struct nfp_net *nn = netdev_priv(netdev);
int err, r; int err, r;
if (nn->dp.ctrl & NFP_NET_CFG_CTRL_ENABLE) {
nn_err(nn, "Dev is already enabled: 0x%08x\n", nn->dp.ctrl);
return -EBUSY;
}
/* Step 1: Allocate resources for rings and the like /* Step 1: Allocate resources for rings and the like
* - Request interrupts * - Request interrupts
* - Allocate RX and TX ring resources * - Allocate RX and TX ring resources
...@@ -2368,11 +2363,6 @@ static int nfp_net_netdev_close(struct net_device *netdev) ...@@ -2368,11 +2363,6 @@ static int nfp_net_netdev_close(struct net_device *netdev)
{ {
struct nfp_net *nn = netdev_priv(netdev); struct nfp_net *nn = netdev_priv(netdev);
if (!(nn->dp.ctrl & NFP_NET_CFG_CTRL_ENABLE)) {
nn_err(nn, "Dev is not up: 0x%08x\n", nn->dp.ctrl);
return 0;
}
/* Step 1: Disable RX and TX rings from the Linux kernel perspective /* Step 1: Disable RX and TX rings from the Linux kernel perspective
*/ */
nfp_net_close_stack(nn); nfp_net_close_stack(nn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment