summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-07-22 10:16:15 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-09-01 15:26:48 +1000
commit7defd282beb57e8880980416ed579f62d561d1ac (patch)
tree3ed972ee790ebe52c2b308d3f805c903239268a2
parent97a4acdac23b8ff33da43917c10b65d2fee5c07f (diff)
xfree86: remove XI86_CONFIGURED flag.
PreInit returns a status code. Let's use that instead of having it report Success in some cases but not set the XI86_CONFIGURED flag and thus signal an init 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>
-rw-r--r--hw/xfree86/common/xf86Xinput.c52
-rw-r--r--hw/xfree86/common/xf86Xinput.h1
2 files changed, 21 insertions, 32 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 0428673c4..c30efb8bc 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -329,36 +329,32 @@ xf86ActivateDevice(LocalDevicePtr local)
{
DeviceIntPtr dev;
- if (local->flags & XI86_CONFIGURED) {
- dev = AddInputDevice(serverClient, local->device_control, TRUE);
+ dev = AddInputDevice(serverClient, local->device_control, TRUE);
- if (dev == NULL)
- {
- xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n",
- local->name);
- local->dev = NULL;
- return FALSE;
- }
+ if (dev == NULL)
+ {
+ xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n",
+ local->name);
+ local->dev = NULL;
+ return FALSE;
+ }
- local->atom = MakeAtom(local->type_name,
- strlen(local->type_name),
- TRUE);
- AssignTypeAndName(dev, local->atom, local->name);
- dev->public.devicePrivate = (pointer) local;
- local->dev = dev;
-
- dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
- dev->type = SLAVE;
- dev->spriteInfo->spriteOwner = FALSE;
+ local->atom = MakeAtom(local->type_name, strlen(local->type_name), TRUE);
+ AssignTypeAndName(dev, local->atom, local->name);
+ dev->public.devicePrivate = local;
+ local->dev = dev;
- dev->config_info = xf86SetStrOption(local->options, "config_info", NULL);
+ dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
+ dev->type = SLAVE;
+ dev->spriteInfo->spriteOwner = FALSE;
- XkbSetExtension(dev, ProcessKeyboardEvent);
+ dev->config_info = xf86SetStrOption(local->options, "config_info", NULL);
- if (serverGeneration == 1)
- xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
- local->name, local->type_name);
- }
+ XkbSetExtension(dev, ProcessKeyboardEvent);
+
+ if (serverGeneration == 1)
+ xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
+ local->name, local->type_name);
return TRUE;
}
@@ -782,12 +778,6 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable)
xf86Msg(X_ERROR, "PreInit returned %d for \"%s\"\n", rval, idev->identifier);
goto unwind;
}
- else if (!(pInfo->flags & XI86_CONFIGURED)) {
- xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n",
- idev->identifier);
- rval = BadMatch;
- goto unwind;
- }
if (!xf86ActivateDevice(pInfo))
{
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 1b71c64a4..7528a51ea 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -59,7 +59,6 @@
#include "XIstubs.h"
/* Input device flags */
-#define XI86_CONFIGURED 0x02 /* the device has been configured */
#define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */
/* the device sends Xinput and core pointer events */
#define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE