]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
Staging: hv: Get rid of the references to the priv element of struct hv_driver in...
authorK. Y. Srinivasan <kys@microsoft.com>
Tue, 26 Apr 2011 16:20:22 +0000 (09:20 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 26 Apr 2011 22:51:45 +0000 (15:51 -0700)
In preparation for getting rid of the priv element from struct hv_driver,
get rid of the references to the priv element of struct
hv_driver in network driver.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/netvsc.c
drivers/staging/hv/netvsc_drv.c

index b3e649785ceb4572a1c582cad6e183cff1e90b2c..27c7449fa1cf0ef17ac604a8c5f82e438e1d8281 100644 (file)
@@ -835,6 +835,9 @@ static void netvsc_receive(struct hv_device *device,
        int i, j;
        int count = 0, bytes_remain = 0;
        unsigned long flags;
+       struct netvsc_driver *netvsc_drv =
+                drv_to_netvscdrv(device->device.driver);
+
        LIST_HEAD(listHead);
 
        net_device = get_inbound_net_device(device);
@@ -995,8 +998,7 @@ static void netvsc_receive(struct hv_device *device,
                }
 
                /* Pass it to the upper layer */
-               ((struct netvsc_driver *)device->drv)->
-                       recv_cb(device, netvsc_packet);
+               netvsc_drv->recv_cb(device, netvsc_packet);
 
                netvsc_receive_completion(netvsc_packet->
                                completion.recv.recv_completion_ctx);
@@ -1102,7 +1104,7 @@ static int netvsc_device_add(struct hv_device *device, void *additional_info)
        struct netvsc_device *net_device;
        struct hv_netvsc_packet *packet, *pos;
        struct netvsc_driver *net_driver =
-                               (struct netvsc_driver *)device->drv;
+               drv_to_netvscdrv(device->device.driver);
 
        net_device = alloc_net_device(device);
        if (!net_device) {
@@ -1183,7 +1185,8 @@ cleanup:
  */
 int netvsc_initialize(struct hv_driver *drv)
 {
-       struct netvsc_driver *driver = (struct netvsc_driver *)drv;
+       struct netvsc_driver *driver =
+               drv_to_netvscdrv(&drv->driver);
 
        drv->name = driver_name;
        memcpy(&drv->dev_type, &netvsc_device_type, sizeof(struct hv_guid));
index 096a7323cea7fb518176f2d6de552787eacb3b15..e61eb7e756e4fbd5cb67bfe39fc917b94f57c0e2 100644 (file)
@@ -132,9 +132,8 @@ static void netvsc_xmit_completion(void *context)
 static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 {
        struct net_device_context *net_device_ctx = netdev_priv(net);
-       struct hv_driver *drv =
-           drv_to_hv_drv(net_device_ctx->device_ctx->device.driver);
-       struct netvsc_driver *net_drv_obj = drv->priv;
+       struct netvsc_driver *net_drv_obj =
+               drv_to_netvscdrv(net_device_ctx->device_ctx->device.driver);
        struct hv_netvsc_packet *packet;
        int ret;
        unsigned int i, num_pages;
@@ -343,9 +342,8 @@ static void netvsc_send_garp(struct work_struct *w)
 
 static int netvsc_probe(struct device *device)
 {
-       struct hv_driver *drv =
-               drv_to_hv_drv(device->driver);
-       struct netvsc_driver *net_drv_obj = drv->priv;
+       struct netvsc_driver *net_drv_obj =
+               drv_to_netvscdrv(device->driver);
        struct hv_device *device_obj = device_to_hv_device(device);
        struct net_device *net = NULL;
        struct net_device_context *net_device_ctx;
@@ -413,9 +411,8 @@ static int netvsc_probe(struct device *device)
 
 static int netvsc_remove(struct device *device)
 {
-       struct hv_driver *drv =
-               drv_to_hv_drv(device->driver);
-       struct netvsc_driver *net_drv_obj = drv->priv;
+       struct netvsc_driver *net_drv_obj =
+               drv_to_netvscdrv(device->driver);
        struct hv_device *device_obj = device_to_hv_device(device);
        struct net_device *net = dev_get_drvdata(&device_obj->device);
        int ret;
@@ -498,7 +495,6 @@ static int netvsc_drv_init(int (*drv_init)(struct hv_driver *drv))
        net_drv_obj->ring_buf_size = ring_size * PAGE_SIZE;
        net_drv_obj->recv_cb = netvsc_recv_callback;
        net_drv_obj->link_status_change = netvsc_linkstatus_callback;
-       drv->priv = net_drv_obj;
 
        /* Callback to client driver to complete the initialization */
        drv_init(&net_drv_obj->base);