summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86Xinput.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-07-21 16:00:26 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-09-01 15:26:46 +1000
commitde0cc5a72deb7c477e368aa4fe9a713788d7ae4c (patch)
tree57ff497440528209fb6e56d46b689851939b6ee7 /hw/xfree86/common/xf86Xinput.c
parent79ee78de9de49d0cab03401662baa476a18e53b8 (diff)
xfree86: rework driver PreInit API - XInput ABI 12
The main change introduced in this patch is the removal of the back-and-forth between DDX and the driver. The DDX now allocates the InputInfoRec and fills it with default values. The DDX processes common options (and module-specific default options, if appropriate) before passing the initialised struct to the driver. The driver may do module-specific initializations and return Success or an error code in the case of a failure. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'hw/xfree86/common/xf86Xinput.c')
-rw-r--r--hw/xfree86/common/xf86Xinput.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index bd77fe663..cc8b96878 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -775,11 +775,13 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable)
goto unwind;
}
- pInfo = drv->PreInit(drv, idev, 0);
+ if (!(pInfo = xf86AllocateInput(drv, idev)))
+ goto unwind;
- if (!pInfo) {
- xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", idev->identifier);
- rval = BadMatch;
+ rval = drv->PreInit(drv, pInfo, 0);
+
+ if (rval != Success) {
+ xf86Msg(X_ERROR, "PreInit returned %d for \"%s\"\n", rval, idev->identifier);
goto unwind;
}
else if (!(pInfo->flags & XI86_CONFIGURED)) {