[PATCH 11/19] xfree86: return the device from xf86ActivateDevice.

Peter Hutterer peter.hutterer at who-t.net
Thu Jul 29 23:21:27 PDT 2010


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 hw/xfree86/common/xf86Xinput.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 1ee1e71..b4ef200 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -311,7 +311,7 @@ xf86ProcessCommonOptions(LocalDevicePtr local,
  * Returns TRUE on success, or FALSE otherwise.
  ***********************************************************************
  */
-static int
+static DeviceIntPtr
 xf86ActivateDevice(LocalDevicePtr local)
 {
     DeviceIntPtr	dev;
@@ -323,7 +323,7 @@ xf86ActivateDevice(LocalDevicePtr local)
         xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n",
                 local->name);
         local->dev = NULL;
-        return FALSE;
+        return NULL;
     }
 
     local->atom = MakeAtom(local->type_name, strlen(local->type_name), TRUE);
@@ -341,7 +341,7 @@ xf86ActivateDevice(LocalDevicePtr local)
         xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
                 local->name, local->type_name);
 
-    return TRUE;
+    return dev;
 }
 
 
@@ -764,13 +764,12 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable)
         goto unwind;
     }
 
-    if (!xf86ActivateDevice(pInfo))
+    if (!(dev = xf86ActivateDevice(pInfo)))
     {
         rval = BadAlloc;
         goto unwind;
     }
 
-    dev = pInfo->dev;
     rval = ActivateDevice(dev, TRUE);
     if (rval != Success)
     {
-- 
1.7.2



More information about the xorg-devel mailing list