diff options
-rw-r--r-- | drivers/input/mouse/vmmouse.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/input/mouse/vmmouse.c b/drivers/input/mouse/vmmouse.c index a3f0f5a47490..0f586780ceb4 100644 --- a/drivers/input/mouse/vmmouse.c +++ b/drivers/input/mouse/vmmouse.c | |||
@@ -355,18 +355,11 @@ int vmmouse_detect(struct psmouse *psmouse, bool set_properties) | |||
355 | return -ENXIO; | 355 | return -ENXIO; |
356 | } | 356 | } |
357 | 357 | ||
358 | if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) { | ||
359 | psmouse_dbg(psmouse, "VMMouse port in use.\n"); | ||
360 | return -EBUSY; | ||
361 | } | ||
362 | |||
363 | /* Check if the device is present */ | 358 | /* Check if the device is present */ |
364 | response = ~VMMOUSE_PROTO_MAGIC; | 359 | response = ~VMMOUSE_PROTO_MAGIC; |
365 | VMMOUSE_CMD(GETVERSION, 0, version, response, dummy1, dummy2); | 360 | VMMOUSE_CMD(GETVERSION, 0, version, response, dummy1, dummy2); |
366 | if (response != VMMOUSE_PROTO_MAGIC || version == 0xffffffffU) { | 361 | if (response != VMMOUSE_PROTO_MAGIC || version == 0xffffffffU) |
367 | release_region(VMMOUSE_PROTO_PORT, 4); | ||
368 | return -ENXIO; | 362 | return -ENXIO; |
369 | } | ||
370 | 363 | ||
371 | if (set_properties) { | 364 | if (set_properties) { |
372 | psmouse->vendor = VMMOUSE_VENDOR; | 365 | psmouse->vendor = VMMOUSE_VENDOR; |
@@ -374,8 +367,6 @@ int vmmouse_detect(struct psmouse *psmouse, bool set_properties) | |||
374 | psmouse->model = version; | 367 | psmouse->model = version; |
375 | } | 368 | } |
376 | 369 | ||
377 | release_region(VMMOUSE_PROTO_PORT, 4); | ||
378 | |||
379 | return 0; | 370 | return 0; |
380 | } | 371 | } |
381 | 372 | ||
@@ -394,7 +385,6 @@ static void vmmouse_disconnect(struct psmouse *psmouse) | |||
394 | psmouse_reset(psmouse); | 385 | psmouse_reset(psmouse); |
395 | input_unregister_device(priv->abs_dev); | 386 | input_unregister_device(priv->abs_dev); |
396 | kfree(priv); | 387 | kfree(priv); |
397 | release_region(VMMOUSE_PROTO_PORT, 4); | ||
398 | } | 388 | } |
399 | 389 | ||
400 | /** | 390 | /** |
@@ -438,15 +428,10 @@ int vmmouse_init(struct psmouse *psmouse) | |||
438 | struct input_dev *rel_dev = psmouse->dev, *abs_dev; | 428 | struct input_dev *rel_dev = psmouse->dev, *abs_dev; |
439 | int error; | 429 | int error; |
440 | 430 | ||
441 | if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) { | ||
442 | psmouse_dbg(psmouse, "VMMouse port in use.\n"); | ||
443 | return -EBUSY; | ||
444 | } | ||
445 | |||
446 | psmouse_reset(psmouse); | 431 | psmouse_reset(psmouse); |
447 | error = vmmouse_enable(psmouse); | 432 | error = vmmouse_enable(psmouse); |
448 | if (error) | 433 | if (error) |
449 | goto release_region; | 434 | return error; |
450 | 435 | ||
451 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 436 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
452 | abs_dev = input_allocate_device(); | 437 | abs_dev = input_allocate_device(); |
@@ -502,8 +487,5 @@ init_fail: | |||
502 | kfree(priv); | 487 | kfree(priv); |
503 | psmouse->private = NULL; | 488 | psmouse->private = NULL; |
504 | 489 | ||
505 | release_region: | ||
506 | release_region(VMMOUSE_PROTO_PORT, 4); | ||
507 | |||
508 | return error; | 490 | return error; |
509 | } | 491 | } |