Staging: hv: Use the shutdown() function in struct hv_driver
authorK. Y. Srinivasan <kys@microsoft.com>
Fri, 29 Apr 2011 20:45:14 +0000 (13:45 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 3 May 2011 20:31:30 +0000 (13:31 -0700)
Use the newly introduced  shutdown() function.

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/blkvsc_drv.c
drivers/staging/hv/vmbus_drv.c

index 80f7c0e310712cd483162fcff43fb63e95f851bf..db44cf683a035e788194fb274363dd8151f4f212 100644 (file)
@@ -585,9 +585,9 @@ static int blkvsc_remove(struct hv_device *dev)
 
 }
 
-static void blkvsc_shutdown(struct device *device)
+static void blkvsc_shutdown(struct hv_device *dev)
 {
-       struct block_device_context *blkdev = dev_get_drvdata(device);
+       struct block_device_context *blkdev = dev_get_drvdata(&dev->device);
        unsigned long flags;
 
        if (!blkdev)
@@ -883,7 +883,7 @@ static int blkvsc_drv_init(void)
 
        drv->probe = blkvsc_probe;
        drv->remove = blkvsc_remove;
-       drv->driver.shutdown = blkvsc_shutdown;
+       drv->shutdown = blkvsc_shutdown;
 
        /* The driver belongs to vmbus */
        ret = vmbus_child_driver_register(&drv->driver);
index b1e6cc4ed821cec25ba2ff1b8266f38baa7eb177..6bf53653a20244843bfa5e0773f82289cf2e0a4d 100644 (file)
@@ -367,6 +367,7 @@ static int vmbus_remove(struct device *child_device)
 static void vmbus_shutdown(struct device *child_device)
 {
        struct hv_driver *drv;
+       struct hv_device *dev = device_to_hv_device(child_device);
 
 
        /* The device may not be attached yet */
@@ -375,9 +376,8 @@ static void vmbus_shutdown(struct device *child_device)
 
        drv = drv_to_hv_drv(child_device->driver);
 
-       /* Let the specific open-source driver handles the removal if it can */
-       if (drv->driver.shutdown)
-               drv->driver.shutdown(child_device);
+       if (drv->shutdown)
+               drv->shutdown(dev);
 
        return;
 }