Commit 2d075346 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: hv: remove unneeded OnOpen callback

This callback only calls one function, so just call the function
instead, no need for indirection at all.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 354b0a64
...@@ -105,7 +105,6 @@ struct netvsc_driver { ...@@ -105,7 +105,6 @@ struct netvsc_driver {
void (*OnLinkStatusChanged)(struct hv_device *dev, u32 Status); void (*OnLinkStatusChanged)(struct hv_device *dev, u32 Status);
/* Specific to this driver */ /* Specific to this driver */
int (*OnOpen)(struct hv_device *dev);
int (*OnClose)(struct hv_device *dev); int (*OnClose)(struct hv_device *dev);
int (*OnSend)(struct hv_device *dev, struct hv_netvsc_packet *packet); int (*OnSend)(struct hv_device *dev, struct hv_netvsc_packet *packet);
...@@ -119,5 +118,6 @@ struct netvsc_device_info { ...@@ -119,5 +118,6 @@ struct netvsc_device_info {
/* Interface */ /* Interface */
int NetVscInitialize(struct hv_driver *drv); int NetVscInitialize(struct hv_driver *drv);
int RndisFilterOnOpen(struct hv_device *Device);
#endif /* _NETVSC_API_H_ */ #endif /* _NETVSC_API_H_ */
...@@ -85,8 +85,6 @@ static int RndisFilterOnDeviceRemove(struct hv_device *Device); ...@@ -85,8 +85,6 @@ static int RndisFilterOnDeviceRemove(struct hv_device *Device);
static void RndisFilterOnCleanup(struct hv_driver *Driver); static void RndisFilterOnCleanup(struct hv_driver *Driver);
static int RndisFilterOnOpen(struct hv_device *Device);
static int RndisFilterOnClose(struct hv_device *Device); static int RndisFilterOnClose(struct hv_device *Device);
static int RndisFilterOnSend(struct hv_device *Device, static int RndisFilterOnSend(struct hv_device *Device,
...@@ -654,7 +652,6 @@ int RndisFilterInit(struct netvsc_driver *Driver) ...@@ -654,7 +652,6 @@ int RndisFilterInit(struct netvsc_driver *Driver)
Driver->Base.OnDeviceRemove = RndisFilterOnDeviceRemove; Driver->Base.OnDeviceRemove = RndisFilterOnDeviceRemove;
Driver->Base.OnCleanup = RndisFilterOnCleanup; Driver->Base.OnCleanup = RndisFilterOnCleanup;
Driver->OnSend = RndisFilterOnSend; Driver->OnSend = RndisFilterOnSend;
Driver->OnOpen = RndisFilterOnOpen;
Driver->OnClose = RndisFilterOnClose; Driver->OnClose = RndisFilterOnClose;
/* Driver->QueryLinkStatus = RndisFilterQueryDeviceLinkStatus; */ /* Driver->QueryLinkStatus = RndisFilterQueryDeviceLinkStatus; */
Driver->OnReceiveCallback = RndisFilterOnReceive; Driver->OnReceiveCallback = RndisFilterOnReceive;
...@@ -888,7 +885,7 @@ static void RndisFilterOnCleanup(struct hv_driver *Driver) ...@@ -888,7 +885,7 @@ static void RndisFilterOnCleanup(struct hv_driver *Driver)
DPRINT_EXIT(NETVSC); DPRINT_EXIT(NETVSC);
} }
static int RndisFilterOnOpen(struct hv_device *Device) int RndisFilterOnOpen(struct hv_device *Device)
{ {
int ret; int ret;
struct netvsc_device *netDevice = Device->Extension; struct netvsc_device *netDevice = Device->Extension;
......
...@@ -72,11 +72,6 @@ static void netvsc_set_multicast_list(struct net_device *net) ...@@ -72,11 +72,6 @@ static void netvsc_set_multicast_list(struct net_device *net)
static int netvsc_open(struct net_device *net) static int netvsc_open(struct net_device *net)
{ {
struct net_device_context *net_device_ctx = netdev_priv(net); struct net_device_context *net_device_ctx = netdev_priv(net);
struct driver_context *driver_ctx =
driver_to_driver_context(net_device_ctx->device_ctx->device.driver);
struct netvsc_driver_context *net_drv_ctx =
(struct netvsc_driver_context *)driver_ctx;
struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
struct hv_device *device_obj = &net_device_ctx->device_ctx->device_obj; struct hv_device *device_obj = &net_device_ctx->device_ctx->device_obj;
int ret = 0; int ret = 0;
...@@ -87,7 +82,7 @@ static int netvsc_open(struct net_device *net) ...@@ -87,7 +82,7 @@ static int netvsc_open(struct net_device *net)
sizeof(struct net_device_stats)); sizeof(struct net_device_stats));
/* Open up the device */ /* Open up the device */
ret = net_drv_obj->OnOpen(device_obj); ret = RndisFilterOnOpen(device_obj);
if (ret != 0) { if (ret != 0) {
DPRINT_ERR(NETVSC_DRV, DPRINT_ERR(NETVSC_DRV,
"unable to open device (ret %d).", ret); "unable to open device (ret %d).", ret);
......
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