summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2011-08-25 16:51:28 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-25 16:51:28 -0700
commit6a180978aea7cb231c60b69b078ec339f40e2faa (patch)
tree73071704e9c63459fdcf774f9c9d52ddd6e726ef /drivers
parent4ab0871ddd1bfdc514f93472cfd68290ecdb62c0 (diff)
downloadop-kernel-dev-6a180978aea7cb231c60b69b078ec339f40e2faa.zip
op-kernel-dev-6a180978aea7cb231c60b69b078ec339f40e2faa.tar.gz
Staging: hv: hv_mouse: fix up remove() function
This function obviously never worked, it was a cut-and-paste from the probe() function. Rewrite it to do what it is supposed to do at least in theory. As to if it works yet, well, it's not worse than it was before, so this can't hurt. Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/hv/hv_mouse.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index 083f28f..090736a 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -847,15 +847,10 @@ static int mousevsc_probe(struct hv_device *dev)
static int mousevsc_remove(struct hv_device *dev)
{
- int ret = 0;
-
struct input_device_context *input_dev_ctx;
+ int ret;
- input_dev_ctx = kmalloc(sizeof(struct input_device_context),
- GFP_KERNEL);
-
- dev_set_drvdata(&dev->device, input_dev_ctx);
-
+ input_dev_ctx = dev_get_drvdata(&dev->device);
if (input_dev_ctx->connected) {
hidinput_disconnect(input_dev_ctx->hid_device);
input_dev_ctx->connected = 0;
@@ -866,7 +861,6 @@ static int mousevsc_remove(struct hv_device *dev)
* is being removed
*/
ret = mousevsc_on_device_remove(dev);
-
if (ret != 0) {
DPRINT_ERR(INPUTVSC_DRV,
"unable to remove vsc device (ret %d)", ret);
OpenPOWER on IntegriCloud