Commit ca6887fb authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: Use the shutdown() function in struct hv_driver

Use the newly introduced  shutdown() function.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b858e745
...@@ -585,9 +585,9 @@ static int blkvsc_remove(struct hv_device *dev) ...@@ -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; unsigned long flags;
if (!blkdev) if (!blkdev)
...@@ -883,7 +883,7 @@ static int blkvsc_drv_init(void) ...@@ -883,7 +883,7 @@ static int blkvsc_drv_init(void)
drv->probe = blkvsc_probe; drv->probe = blkvsc_probe;
drv->remove = blkvsc_remove; drv->remove = blkvsc_remove;
drv->driver.shutdown = blkvsc_shutdown; drv->shutdown = blkvsc_shutdown;
/* The driver belongs to vmbus */ /* The driver belongs to vmbus */
ret = vmbus_child_driver_register(&drv->driver); ret = vmbus_child_driver_register(&drv->driver);
......
...@@ -367,6 +367,7 @@ static int vmbus_remove(struct device *child_device) ...@@ -367,6 +367,7 @@ static int vmbus_remove(struct device *child_device)
static void vmbus_shutdown(struct device *child_device) static void vmbus_shutdown(struct device *child_device)
{ {
struct hv_driver *drv; struct hv_driver *drv;
struct hv_device *dev = device_to_hv_device(child_device);
/* The device may not be attached yet */ /* The device may not be attached yet */
...@@ -375,9 +376,8 @@ static void vmbus_shutdown(struct device *child_device) ...@@ -375,9 +376,8 @@ static void vmbus_shutdown(struct device *child_device)
drv = drv_to_hv_drv(child_device->driver); drv = drv_to_hv_drv(child_device->driver);
/* Let the specific open-source driver handles the removal if it can */ if (drv->shutdown)
if (drv->driver.shutdown) drv->shutdown(dev);
drv->driver.shutdown(child_device);
return; return;
} }
......
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