aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2011-05-12 19:34:46 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-17 12:27:10 -0700
commit96053efd3c8e13f85abe9783be0e70cb97e82f2b (patch)
tree455be4d33012a4a20c299a0b5624986e67ecf1b6 /drivers/staging/hv
parentStaging: hv: storvsc_drv: Cleanup storvsc_drv_exit() function (diff)
downloadlinux-dev-96053efd3c8e13f85abe9783be0e70cb97e82f2b.tar.xz
linux-dev-96053efd3c8e13f85abe9783be0e70cb97e82f2b.zip
Staging: hv: mousevsc_drv: Cleanup mousevsc_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 mousevsc_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/hv_mouse.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index 1869e2531d40..359e73741c48 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -915,13 +915,6 @@ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
kfree(hid_dev);
}
-static int mousevsc_drv_exit_cb(struct device *dev, void *data)
-{
- struct device **curr = (struct device **)data;
- *curr = dev;
-
- return 1;
-}
static struct hv_driver mousevsc_drv = {
.probe = mousevsc_probe,
@@ -930,31 +923,7 @@ static struct hv_driver mousevsc_drv = {
static void mousevsc_drv_exit(void)
{
- struct hv_driver *drv = &mousevsc_drv;
- int ret;
-
- struct device *current_dev = NULL;
-
- while (1) {
- current_dev = NULL;
-
- /* Get the device */
- ret = driver_for_each_device(&drv->driver, NULL,
- (void *)&current_dev,
- mousevsc_drv_exit_cb);
- if (ret)
- printk(KERN_ERR "Can't find mouse device!\n");
-
- 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(&mousevsc_drv.driver);
}
static int __init mousevsc_init(void)