[PATCH 2/5] systemd_logind_find_info_ptr_by_devnum: Move to higher inside the file

Hans de Goede hdegoede at redhat.com
Wed Mar 12 08:08:14 PDT 2014


This is a preparation patch for adding support for server managed fds
for InputDevices where multiple input devices share the same device node (and
thus also their major and minor).

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 hw/xfree86/os-support/linux/systemd-logind.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c
index 09db336..012a920 100644
--- a/hw/xfree86/os-support/linux/systemd-logind.c
+++ b/hw/xfree86/os-support/linux/systemd-logind.c
@@ -51,6 +51,20 @@ struct systemd_logind_info {
 
 static struct systemd_logind_info logind_info;
 
+static InputInfoPtr
+systemd_logind_find_info_ptr_by_devnum(InputInfoPtr start,
+                                       int major, int minor)
+{
+    InputInfoPtr pInfo;
+
+    for (pInfo = start; pInfo; pInfo = pInfo->next)
+        if (pInfo->major == major && pInfo->minor == minor &&
+                (pInfo->flags & XI86_SERVER_FD))
+            return pInfo;
+
+    return NULL;
+}
+
 int
 systemd_logind_take_fd(int _major, int _minor, const char *path,
                        Bool *paused_ret)
@@ -203,20 +217,6 @@ systemd_logind_vtenter(void)
     xf86InputEnableVTProbe();
 }
 
-static InputInfoPtr
-systemd_logind_find_info_ptr_by_devnum(InputInfoPtr start,
-                                       int major, int minor)
-{
-    InputInfoPtr pInfo;
-
-    for (pInfo = start; pInfo; pInfo = pInfo->next)
-        if (pInfo->major == major && pInfo->minor == minor &&
-                (pInfo->flags & XI86_SERVER_FD))
-            return pInfo;
-
-    return NULL;
-}
-
 static void
 systemd_logind_ack_pause(struct systemd_logind_info *info,
                          dbus_int32_t minor, dbus_int32_t major)
-- 
1.9.0



More information about the xorg-devel mailing list