Commit 2289f0aa authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

netvsc: simplify rndis_filter_remove

All caller's already have pointer to netvsc_device so pass it.
Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2c7f83ca
...@@ -198,7 +198,8 @@ int rndis_filter_open(struct netvsc_device *nvdev); ...@@ -198,7 +198,8 @@ int rndis_filter_open(struct netvsc_device *nvdev);
int rndis_filter_close(struct netvsc_device *nvdev); int rndis_filter_close(struct netvsc_device *nvdev);
int rndis_filter_device_add(struct hv_device *dev, int rndis_filter_device_add(struct hv_device *dev,
struct netvsc_device_info *info); struct netvsc_device_info *info);
void rndis_filter_device_remove(struct hv_device *dev); void rndis_filter_device_remove(struct hv_device *dev,
struct netvsc_device *nvdev);
int rndis_filter_set_rss_param(struct rndis_device *rdev, int rndis_filter_set_rss_param(struct rndis_device *rdev,
const u8 *key, int num_queue); const u8 *key, int num_queue);
int rndis_filter_receive(struct net_device *ndev, int rndis_filter_receive(struct net_device *ndev,
......
...@@ -780,7 +780,7 @@ static int netvsc_set_channels(struct net_device *net, ...@@ -780,7 +780,7 @@ static int netvsc_set_channels(struct net_device *net,
return ret; return ret;
net_device_ctx->start_remove = true; net_device_ctx->start_remove = true;
rndis_filter_device_remove(dev); rndis_filter_device_remove(dev, nvdev);
ret = netvsc_set_queues(net, dev, count); ret = netvsc_set_queues(net, dev, count);
if (ret == 0) if (ret == 0)
...@@ -865,7 +865,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu) ...@@ -865,7 +865,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
goto out; goto out;
ndevctx->start_remove = true; ndevctx->start_remove = true;
rndis_filter_device_remove(hdev); rndis_filter_device_remove(hdev, nvdev);
ndev->mtu = mtu; ndev->mtu = mtu;
...@@ -1493,7 +1493,7 @@ static int netvsc_probe(struct hv_device *dev, ...@@ -1493,7 +1493,7 @@ static int netvsc_probe(struct hv_device *dev,
ret = register_netdev(net); ret = register_netdev(net);
if (ret != 0) { if (ret != 0) {
pr_err("Unable to register netdev.\n"); pr_err("Unable to register netdev.\n");
rndis_filter_device_remove(dev); rndis_filter_device_remove(dev, nvdev);
netvsc_free_netdev(net); netvsc_free_netdev(net);
} }
...@@ -1533,7 +1533,7 @@ static int netvsc_remove(struct hv_device *dev) ...@@ -1533,7 +1533,7 @@ static int netvsc_remove(struct hv_device *dev)
* Call to the vsc driver to let it know that the device is being * Call to the vsc driver to let it know that the device is being
* removed * removed
*/ */
rndis_filter_device_remove(dev); rndis_filter_device_remove(dev, ndev_ctx->nvdev);
hv_set_drvdata(dev, NULL); hv_set_drvdata(dev, NULL);
......
...@@ -1053,7 +1053,7 @@ int rndis_filter_device_add(struct hv_device *dev, ...@@ -1053,7 +1053,7 @@ int rndis_filter_device_add(struct hv_device *dev,
/* Send the rndis initialization message */ /* Send the rndis initialization message */
ret = rndis_filter_init_device(rndis_device); ret = rndis_filter_init_device(rndis_device);
if (ret != 0) { if (ret != 0) {
rndis_filter_device_remove(dev); rndis_filter_device_remove(dev, net_device);
return ret; return ret;
} }
...@@ -1068,7 +1068,7 @@ int rndis_filter_device_add(struct hv_device *dev, ...@@ -1068,7 +1068,7 @@ int rndis_filter_device_add(struct hv_device *dev,
/* Get the mac address */ /* Get the mac address */
ret = rndis_filter_query_device_mac(rndis_device); ret = rndis_filter_query_device_mac(rndis_device);
if (ret != 0) { if (ret != 0) {
rndis_filter_device_remove(dev); rndis_filter_device_remove(dev, net_device);
return ret; return ret;
} }
...@@ -1077,7 +1077,7 @@ int rndis_filter_device_add(struct hv_device *dev, ...@@ -1077,7 +1077,7 @@ int rndis_filter_device_add(struct hv_device *dev,
/* Find HW offload capabilities */ /* Find HW offload capabilities */
ret = rndis_query_hwcaps(rndis_device, &hwcaps); ret = rndis_query_hwcaps(rndis_device, &hwcaps);
if (ret != 0) { if (ret != 0) {
rndis_filter_device_remove(dev); rndis_filter_device_remove(dev, net_device);
return ret; return ret;
} }
...@@ -1233,13 +1233,13 @@ int rndis_filter_device_add(struct hv_device *dev, ...@@ -1233,13 +1233,13 @@ int rndis_filter_device_add(struct hv_device *dev,
return 0; /* return 0 because primary channel can be used alone */ return 0; /* return 0 because primary channel can be used alone */
err_dev_remv: err_dev_remv:
rndis_filter_device_remove(dev); rndis_filter_device_remove(dev, net_device);
return ret; return ret;
} }
void rndis_filter_device_remove(struct hv_device *dev) void rndis_filter_device_remove(struct hv_device *dev,
struct netvsc_device *net_dev)
{ {
struct netvsc_device *net_dev = hv_device_to_netvsc_device(dev);
struct rndis_device *rndis_dev = net_dev->extension; struct rndis_device *rndis_dev = net_dev->extension;
/* If not all subchannel offers are complete, wait for them until /* If not all subchannel offers are complete, wait for them until
......
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