diff options
author | K. Y. Srinivasan | 2011-05-13 04:34:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2011-05-17 21:27:11 +0200 |
commit | a881fdd0cab987336a7a1b99630b3460689a3a60 (patch) | |
tree | ed4435e1e2592d3d2842c5672e3dc374941d7db6 /drivers/staging/hv | |
parent | Staging: hv: mousevsc_drv: Cleanup mousevsc_drv_exit() function (diff) | |
download | kernel-qcow2-linux-a881fdd0cab987336a7a1b99630b3460689a3a60.tar.gz kernel-qcow2-linux-a881fdd0cab987336a7a1b99630b3460689a3a60.tar.xz kernel-qcow2-linux-a881fdd0cab987336a7a1b99630b3460689a3a60.zip |
Staging: hv: netvsc_drv: Clean up the netvsc_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 netvsc_drv_exit() routine
keeping this in mind.
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>
Diffstat (limited to 'drivers/staging/hv')
-rw-r--r-- | drivers/staging/hv/netvsc_drv.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c index ced380289962..7b6844f16c4a 100644 --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c @@ -428,15 +428,6 @@ static int netvsc_remove(struct hv_device *dev) return ret; } -static int netvsc_drv_exit_cb(struct device *dev, void *data) -{ - struct device **curr = (struct device **)data; - - *curr = dev; - /* stop iterating */ - return 1; -} - /* The one and only one */ static struct netvsc_driver netvsc_drv = { .base.probe = netvsc_probe, @@ -445,30 +436,7 @@ static struct netvsc_driver netvsc_drv = { static void netvsc_drv_exit(void) { - struct hv_driver *drv = &netvsc_drv.base; - struct device *current_dev; - int ret; - - while (1) { - current_dev = NULL; - - /* Get the device */ - ret = driver_for_each_device(&drv->driver, NULL, - ¤t_dev, netvsc_drv_exit_cb); - - if (current_dev == NULL) - break; - - /* Initiate removal from the top-down */ - dev_err(current_dev, "unregistering device (%s)...\n", - dev_name(current_dev)); - - device_unregister(current_dev); - } - - vmbus_child_driver_unregister(&drv->driver); - - return; + vmbus_child_driver_unregister(&netvsc_drv.base.driver); } static int netvsc_drv_init(int (*drv_init)(struct hv_driver *drv)) |