提交 2bda87cb 编写于 作者: K K. Y. Srinivasan 提交者: Greg Kroah-Hartman

Staging: hv: storvsc_drv: Cleanup storvsc_drv_exit() function

To conform to the Linux device model, the device should persist even
when there is no driver bound to it. Cleanup the storvsc_drv_exit() routine
keeping this in mind.
Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: NHank Janssen <hjanssen@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 8553d753
......@@ -792,37 +792,9 @@ static int storvsc_drv_init(void)
return ret;
}
static int storvsc_drv_exit_cb(struct device *dev, void *data)
{
struct device **curr = (struct device **)data;
*curr = dev;
return 1; /* stop iterating */
}
static void storvsc_drv_exit(void)
{
struct hv_driver *drv = &storvsc_drv;
struct device *current_dev = NULL;
int ret;
while (1) {
current_dev = NULL;
/* Get the device */
ret = driver_for_each_device(&drv->driver, NULL,
(void *) &current_dev,
storvsc_drv_exit_cb);
if (current_dev == NULL)
break;
/* Initiate removal from the top-down */
device_unregister(current_dev);
}
vmbus_child_driver_unregister(&drv->driver);
return;
vmbus_child_driver_unregister(&storvsc_drv.driver);
}
static int __init storvsc_init(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册