diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-10-26 10:43:42 +1000 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2010-11-04 08:54:38 +0100 |
commit | 4527ef863a4c4d3e499007abb65dbb5e086219e8 (patch) | |
tree | 09a6a5fc6cba36e02740f3e697ec71eb475a2e02 /src/vmmouse.c | |
parent | 6561d57d4cc8ba5a68c4f333a48eb2f9f131be7b (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>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'src/vmmouse.c')
-rw-r--r-- | src/vmmouse.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/vmmouse.c b/src/vmmouse.c index 00960cc..86f1ccf 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 |