summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-10-26 10:43:42 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-10-26 11:32:17 +1000
commitac26c380f2c6271f2dc0392e7e23af309febd06f (patch)
tree30374960177b6cb1bdd5614dc060444933d21ee0
parenta413df647f0b34bc0386e86b7ed7ea2e334c4664 (diff)
Move passthrough initialization out into a separate function.
No functional changes, just modularising a bit to make future changes easier. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/vmmouse.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/vmmouse.c b/src/vmmouse.c
index 00960cc..2f66b67 100644
--- a/src/vmmouse.c
+++ b/src/vmmouse.c
@@ -217,6 +217,17 @@ static char reverseMap[32] = { 0, 4, 2, 6, 1, 5, 3, 7,
#define reverseBits(map, b) (((b) & ~0x0f) | map[(b) & 0x0f])
+static InputInfoPtr
+VMMouseInitPassthru(InputDriverPtr drv, IDevPtr dev, int flags)
+{
+ InputDriverRec *passthruMouse;
+ passthruMouse = (InputDriverRec *)LoaderSymbol("MOUSE");
+ if(passthruMouse != NULL){
+ return (passthruMouse->PreInit)(drv, dev, flags);
+ } else {
+ return NULL;
+ }
+}
/*
*----------------------------------------------------------------------
@@ -274,16 +285,9 @@ VMMousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
* vmmouse failed
* Fall back to normal mouse module
*/
- InputDriverRec *passthruMouse;
xf86Msg(X_ERROR, "VMWARE(0): vmmouse enable failed\n");
- passthruMouse = (InputDriverRec *)LoaderSymbol("MOUSE");
free(mPriv);
- if(passthruMouse != NULL){
- return (passthruMouse->PreInit)(drv, dev, flags);
- } else {
- return NULL;
- }
-
+ return VMMouseInitPassthru(drv, dev, flags);
} else {
/*
* vmmouse is available