xserver: Branch 'master' - 18 commits

Adam Jackson ajax at kemper.freedesktop.org
Wed Jan 25 19:30:03 UTC 2017


 hw/xfree86/common/xf86.h          |    2 
 hw/xfree86/common/xf86Config.c    |   78 ------
 hw/xfree86/common/xf86Config.h    |    1 
 hw/xfree86/common/xf86Configure.c |  103 ++++++-
 hw/xfree86/common/xf86Helper.c    |   19 -
 hw/xfree86/common/xf86Init.c      |    6 
 hw/xfree86/common/xf86Module.h    |   31 --
 hw/xfree86/common/xf86str.h       |   10 
 hw/xfree86/doc/ddxDesign.xml      |   81 +-----
 hw/xfree86/loader/Makefile.am     |    3 
 hw/xfree86/loader/loader.c        |   47 +--
 hw/xfree86/loader/loader.h        |    2 
 hw/xfree86/loader/loaderProcs.h   |   10 
 hw/xfree86/loader/loadmod.c       |  492 ++++++++++----------------------------
 hw/xfree86/loader/os.c            |   72 -----
 15 files changed, 261 insertions(+), 696 deletions(-)

New commits:
commit cc0f173ea2936d1405e382329c1bd58c7af67ea7
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 14 15:56:46 2016 -0400

    loader: Learn about the joy of snprintf
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index cb86925..ca77c7a 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -335,10 +335,7 @@ FindModule(const char *module, const char *dirname, PatternPtr patterns)
         return NULL;
 
     for (s = stdSubdirs; *s; s++) {
-        if ((strlen(dirname) + strlen(*s)) > PATH_MAX)
-            continue;
-        strcpy(buf, dirname);
-        strcat(buf, *s);
+        snprintf(buf, PATH_MAX, "%s%s", dirname, *s);
         if ((name = FindModuleInSubdir(buf, module)))
             break;
     }
@@ -371,11 +368,7 @@ LoaderListDir(const char *subdir, const char **patternlist)
         goto bail;
 
     for (elem = pathlist; *elem; elem++) {
-        if ((dirlen = strlen(*elem) + strlen(subdir) + 1) > PATH_MAX)
-            continue;
-        strcpy(buf, *elem);
-        strcat(buf, "/");
-        strcat(buf, subdir);
+        dirlen = snprintf(buf, PATH_MAX, "%s/%s", *elem, subdir);
         fp = buf + dirlen;
         if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) &&
             (d = opendir(buf))) {
commit 8e83eacb9e2d2c6c2b9f8cdb9e82c976a0237f24
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 14 15:30:35 2016 -0400

    loader: Remove unused path and name from ModuleDescPtr
    
    Just a waste of memory. Path was never referenced at all, and name was
    only used when unloading the module; we can just as well get the
    module's internal idea of its name from VersionInfo.
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index 84ed103..8b16cb7 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -59,8 +59,6 @@ typedef struct module_desc {
     struct module_desc *child;
     struct module_desc *sib;
     struct module_desc *parent;
-    char *name;
-    char *path;
     void *handle;
     ModuleSetupProc SetupProc;
     ModuleTearDownProc TearDownProc;
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index fc982c7..cb86925 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -600,17 +600,6 @@ LoadSubModule(void *_parent, const char *module,
     return submod;
 }
 
-static ModuleDescPtr
-NewModuleDesc(const char *name)
-{
-    ModuleDescPtr mdp = calloc(1, sizeof(ModuleDesc));
-
-    if (mdp)
-        mdp->name = xstrdup(name);
-
-    return mdp;
-}
-
 ModuleDescPtr
 DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
 {
@@ -619,7 +608,7 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
     if (!mod)
         return NULL;
 
-    ret = NewModuleDesc(mod->name);
+    ret = calloc(1, sizeof(ModuleDesc));
     if (ret == NULL)
         return NULL;
 
@@ -632,7 +621,6 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
     ret->sib = DuplicateModule(mod->sib, parent);
     ret->parent = parent;
     ret->VersionInfo = mod->VersionInfo;
-    ret->path = strdup(mod->path);
 
     return ret;
 }
@@ -726,7 +714,7 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
             *errmaj = LDR_BADUSAGE;
         goto LoadModule_fail;
     }
-    ret = NewModuleDesc(name);
+    ret = calloc(1, sizeof(ModuleDesc));
     if (!ret) {
         if (errmaj)
             *errmaj = LDR_NOMEM;
@@ -773,7 +761,6 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
     ret->handle = LoaderOpen(found, errmaj);
     if (ret->handle == NULL)
         goto LoadModule_fail;
-    ret->path = strdup(found);
 
     /* drop any explicit suffix from the module name */
     p = strchr(name, '.');
@@ -857,31 +844,31 @@ void
 UnloadModule(void *_mod)
 {
     ModuleDescPtr mod = _mod;
+    const char *name;
 
     if (mod == (ModuleDescPtr) 1)
         return;
 
-    if (mod == NULL || mod->name == NULL)
+    if (mod == NULL)
         return;
 
+    name = mod->VersionInfo->modname;
+
     if (mod->parent)
-        LogMessageVerbSigSafe(X_INFO, 3, "UnloadSubModule: \"%s\"\n",
-                              mod->name);
+        LogMessageVerbSigSafe(X_INFO, 3, "UnloadSubModule: \"%s\"\n", name);
     else
-        LogMessageVerbSigSafe(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name);
+        LogMessageVerbSigSafe(X_INFO, 3, "UnloadModule: \"%s\"\n", name);
 
     if (mod->TearDownData != ModuleDuplicated) {
         if ((mod->TearDownProc) && (mod->TearDownData))
             mod->TearDownProc(mod->TearDownData);
-        LoaderUnload(mod->name, mod->handle);
+        LoaderUnload(name, mod->handle);
     }
 
     if (mod->child)
         UnloadModule(mod->child);
     if (mod->sib)
         UnloadModule(mod->sib);
-    free(mod->path);
-    free(mod->name);
     free(mod);
 }
 
commit 8920dca0091675f1202c1198336cd4d8e0259100
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 14 11:45:58 2016 -0400

    loader: Remove unused arguments from LoadModule
    
    Nobody was ever calling this with a non-null argument for subdir list or
    pattern list.  Having done this, InitSubdirs is only ever called with a
    NULL argument, so it's really just a complicated way of duplicating the
    default list; we can remove that and just walk the list directly.
    
    The minor error code was only ever used to distinguish among two cases
    of LDR_BADUSAGE. Whatever.
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index b464864..7d6a374 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1590,7 +1590,7 @@ xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name)
 void *
 xf86LoadOneModule(const char *name, void *opt)
 {
-    int errmaj, errmin;
+    int errmaj;
     char *Name;
     void *mod;
 
@@ -1608,9 +1608,9 @@ xf86LoadOneModule(const char *name, void *opt)
         return NULL;
     }
 
-    mod = LoadModule(Name, NULL, NULL, opt, NULL, &errmaj, &errmin);
+    mod = LoadModule(Name, opt, NULL, &errmaj);
     if (!mod)
-        LoaderErrorMsg(NULL, Name, errmaj, errmin);
+        LoaderErrorMsg(NULL, Name, errmaj, 0);
     free(Name);
     return mod;
 }
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index f6f77c0..e61fe66 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1473,7 +1473,7 @@ ddxUseMsg(void)
 Bool
 xf86LoadModules(const char **list, void **optlist)
 {
-    int errmaj, errmin;
+    int errmaj;
     void *opt;
     int i;
     char *name;
@@ -1503,8 +1503,8 @@ xf86LoadModules(const char **list, void **optlist)
         else
             opt = NULL;
 
-        if (!LoadModule(name, NULL, NULL, opt, NULL, &errmaj, &errmin)) {
-            LoaderErrorMsg(NULL, name, errmaj, errmin);
+        if (!LoadModule(name, opt, NULL, &errmaj)) {
+            LoaderErrorMsg(NULL, name, errmaj, 0);
             failed = TRUE;
         }
         free(name);
diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index 05ee042..89a85a4 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -5210,10 +5210,8 @@ XFree86 common layer.
 
       <blockquote><para>
 	  <programlisting>
-    pointer LoadModule(const char *module,
-                       const char **subdirlist, const char **patternlist,
-                       pointer options, const XF86ModReqInfo * modreq,
-                       int *errmaj, int *errmin);
+    pointer LoadModule(const char *module, pointer options,
+                       const XF86ModReqInfo * modreq, int *errmaj);
 	  </programlisting>
 	  <blockquote><para>
     The <function>LoadModule()</function> function loads the module called
@@ -5227,42 +5225,6 @@ XFree86 common layer.
 
 	      <variablelist>
 
-
-		<varlistentry>
-		  <term><parameter>subdirlist</parameter></term>
-		  <listitem><para>
-		  An optional <constant>NULL</constant> terminated list of
-		  subdirectories to search.  When <constant>NULL</constant>,
-		  the default built-in list is used (refer to
-		  <varname>stdSubdirs</varname> in <filename>loadmod.c</filename>).
-		  The default list is also substituted for entries in
-		  <parameter>subdirlist</parameter> with the value
-		  <constant>DEFAULT_LIST</constant>.  This makes is possible
-		  to augment the default list instead of replacing it.
-		  Subdir elements must be relative, and must not contain
-		  <literal remap="tt">".."</literal>.  If any violate this requirement,
-		  the load fails.
-		    </para></listitem></varlistentry>
-
-
-		<varlistentry>
-		  <term><parameter>patternlist</parameter></term>
-		  <listitem><para>
-		  An optional <constant>NULL</constant> terminated list of
-		  POSIX regular expressions used to connect module
-		  filenames with canonical module names.  Each regex
-		  should contain exactly one subexpression that corresponds
-		  to the canonical module name.  When <constant>NULL</constant>,
-		  the default built-in list is used (refer to
-		  <varname>stdPatterns</varname> in
-		  <filename>loadmod.c</filename>).  The default list is also
-		  substituted for entries in <parameter>patternlist</parameter>
-		  with the value <constant>DEFAULT_LIST</constant>.  This
-		  makes it possible to augment the default list instead
-		  of replacing it.
-		    </para></listitem></varlistentry>
-
-
 		<varlistentry>
 		  <term><parameter>options</parameter></term>
 		  <listitem><para>
@@ -5371,13 +5333,6 @@ typedef struct {
 		  <function>LoadModule()</function> fails.
 		    </para></listitem></varlistentry>
 
-		<varlistentry>
-		  <term><parameter>errmin</parameter></term>
-		  <listitem><para>
-		  Like <parameter>errmaj</parameter>, but for the minor part
-		  of the error code.
-		    </para></listitem></varlistentry>
-
 	      </variablelist>
 
 	    </para></blockquote>
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index fded87b..86629b2 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -89,7 +89,7 @@ LoaderInit(void)
 /* Public Interface to the loader. */
 
 void *
-LoaderOpen(const char *module, int *errmaj, int *errmin)
+LoaderOpen(const char *module, int *errmaj)
 {
     void *ret;
 
@@ -103,8 +103,6 @@ LoaderOpen(const char *module, int *errmaj, int *errmin)
         LogMessage(X_ERROR, "Failed to load %s: %s\n", module, dlerror());
         if (errmaj)
             *errmaj = LDR_NOLOAD;
-        if (errmin)
-            *errmin = LDR_NOLOAD;
         return NULL;
     }
 
diff --git a/hw/xfree86/loader/loader.h b/hw/xfree86/loader/loader.h
index c89c641..5a2fe6c 100644
--- a/hw/xfree86/loader/loader.h
+++ b/hw/xfree86/loader/loader.h
@@ -71,7 +71,7 @@ extern const ModuleVersions LoaderVersionInfo;
 extern unsigned long LoaderOptions;
 
 /* Internal Functions */
-void *LoaderOpen(const char *, int *, int *);
+void *LoaderOpen(const char *, int *);
 void *LoaderSymbolFromModule(void *, const char *);
 
 #endif                          /* _LOADER_H */
diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index 65ca2ec..84ed103 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -72,9 +72,7 @@ typedef struct module_desc {
 
 void LoaderInit(void);
 
-ModuleDescPtr LoadModule(const char *, const char **,
-                         const char **, void *, const XF86ModReqInfo *,
-                         int *, int *);
+ModuleDescPtr LoadModule(const char *, void *, const XF86ModReqInfo *, int *);
 ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent);
 void UnloadDriver(ModuleDescPtr);
 void LoaderSetPath(const char *path);
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index ce10974..fc982c7 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -67,7 +67,7 @@ typedef struct _pattern {
 } PatternRec, *PatternPtr;
 
 /* Prototypes for static functions */
-static char *FindModule(const char *, const char *, const char **, PatternPtr);
+static char *FindModule(const char *, const char *, PatternPtr);
 static Bool CheckVersion(const char *, XF86ModuleVersionInfo *,
                          const XF86ModReqInfo *);
 static char *LoaderGetCanonicalName(const char *, PatternPtr);
@@ -261,99 +261,6 @@ FreePatterns(PatternPtr patterns)
         free(patterns);
 }
 
-static const char **
-InitSubdirs(const char **subdirlist)
-{
-    int i;
-    const char **tmp_subdirlist = NULL;
-    char **subdirs = NULL;
-    const char **s, **stmp = NULL;
-    int len;
-    Bool indefault;
-
-    if (subdirlist == NULL) {
-        subdirlist = tmp_subdirlist = malloc(2 * sizeof(char *));
-        if (subdirlist == NULL)
-            return NULL;
-        subdirlist[0] = DEFAULT_LIST;
-        subdirlist[1] = NULL;
-    }
-
-    {
-        /* Count number of entries and check for invalid paths */
-        for (i = 0, s = subdirlist; *s; i++, s++) {
-            if (*s == DEFAULT_LIST) {
-                i += sizeof(stdSubdirs) / sizeof(stdSubdirs[0]) - 1 - 1;
-            }
-            else {
-                /*
-                 * Path validity check.  Don't allow absolute paths, or
-                 * paths containing "..".  To catch absolute paths on
-                 * platforms that use driver letters, don't allow the ':'
-                 * character to appear at all.
-                 */
-                if (**s == '/' || **s == '\\' || strchr(*s, ':') ||
-                    strstr(*s, "..")) {
-                    LogMessage(X_ERROR, "InitSubdirs: Bad subdir \"%s\"\n", *s);
-                    free(tmp_subdirlist);
-                    return NULL;
-                }
-            }
-        }
-        subdirs = xallocarray(i * 2 + 1, sizeof(char *));
-        if (!subdirs) {
-            free(tmp_subdirlist);
-            return NULL;
-        }
-        i = 0;
-        s = subdirlist;
-        indefault = FALSE;
-        while (*s) {
-            if (*s == DEFAULT_LIST) {
-                /* Divert to the default list */
-                indefault = TRUE;
-                stmp = ++s;
-                s = stdSubdirs;
-            }
-            len = strlen(*s);
-            if (**s && (*s)[len - 1] != '/') {
-                len++;
-            }
-            if (!(subdirs[i] = malloc(len))) {
-                while (--i >= 0)
-                    free(subdirs[i]);
-                free(subdirs);
-                free(tmp_subdirlist);
-                return NULL;
-            }
-            /* path as given */
-            subdirs[i] = strdup(*s);
-            i++;
-            s++;
-            if (indefault && !s) {
-                /* revert back to the main list */
-                indefault = FALSE;
-                s = stmp;
-            }
-        }
-        subdirs[i] = NULL;
-    }
-    free(tmp_subdirlist);
-    return (const char **) subdirs;
-}
-
-static void
-FreeSubdirs(const char **subdirs)
-{
-    const char **s;
-
-    if (subdirs) {
-        for (s = subdirs; *s; s++)
-            free((char *) *s);
-        free(subdirs);
-    }
-}
-
 static char *
 FindModuleInSubdir(const char *dirpath, const char *module)
 {
@@ -418,22 +325,16 @@ FindModuleInSubdir(const char *dirpath, const char *module)
 }
 
 static char *
-FindModule(const char *module, const char *dirname, const char **subdirlist,
-           PatternPtr patterns)
+FindModule(const char *module, const char *dirname, PatternPtr patterns)
 {
     char buf[PATH_MAX + 1];
     char *name = NULL;
-    const char **subdirs = NULL;
     const char **s;
 
     if (strlen(dirname) > PATH_MAX)
         return NULL;
 
-    subdirs = InitSubdirs(subdirlist);
-    if (!subdirs)
-        return NULL;
-
-    for (s = subdirs; *s; s++) {
+    for (s = stdSubdirs; *s; s++) {
         if ((strlen(dirname) + strlen(*s)) > PATH_MAX)
             continue;
         strcpy(buf, dirname);
@@ -442,8 +343,6 @@ FindModule(const char *module, const char *dirname, const char **subdirlist,
             break;
     }
 
-    FreeSubdirs(subdirs);
-
     return name;
 }
 
@@ -693,8 +592,7 @@ LoadSubModule(void *_parent, const char *module,
         return NULL;
     }
 
-    submod = LoadModule(module, subdirlist, patternlist, options,
-                        modreq, errmaj, errmin);
+    submod = LoadModule(module, options, modreq, errmaj);
     if (submod && submod != (ModuleDescPtr) 1) {
         parent->child = AddSibling(parent->child, submod);
         submod->parent = parent;
@@ -763,15 +661,6 @@ static const char *compiled_in_modules[] = {
  * module       The module name.  Normally this is not a filename but the
  *              module's "canonical name.  A full pathname is, however,
  *              also accepted.
- * subdirlist   A NULL terminated list of subdirectories to search.  When
- *              NULL, the default "stdSubdirs" list is used.  The default
- *              list is also substituted for entries with value DEFAULT_LIST.
- * patternlist  A NULL terminated list of regular expressions used to find
- *              module filenames.  Each regex should contain exactly one
- *              subexpression that corresponds to the canonical module name.
- *              When NULL, the default "stdPatterns" list is used.  The
- *              default list is also substituted for entries with value
- *              DEFAULT_LIST.
  * options      A NULL terminated list of Options that are passed to the
  *              module's SetupProc function.
  * modreq       An optional XF86ModReqInfo* containing
@@ -790,13 +679,11 @@ static const char *compiled_in_modules[] = {
  *                               string
  *              "don't care" values are ~0 for numbers, and NULL for strings
  * errmaj       Major error return.
- * errmin       Minor error return.
  *
  */
 ModuleDescPtr
-LoadModule(const char *module, const char **subdirlist,
-           const char **patternlist, void *options,
-           const XF86ModReqInfo * modreq, int *errmaj, int *errmin)
+LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
+           int *errmaj)
 {
     XF86ModuleData *initdata = NULL;
     char **pathlist = NULL;
@@ -812,7 +699,7 @@ LoadModule(const char *module, const char **subdirlist,
 
     LogMessageVerb(X_INFO, 3, "LoadModule: \"%s\"", module);
 
-    patterns = InitPatterns(patternlist);
+    patterns = InitPatterns(NULL);
     name = LoaderGetCanonicalName(module, patterns);
     noncanonical = (name && strcmp(module, name) != 0);
     if (noncanonical) {
@@ -837,16 +724,12 @@ LoadModule(const char *module, const char **subdirlist,
     if (!name) {
         if (errmaj)
             *errmaj = LDR_BADUSAGE;
-        if (errmin)
-            *errmin = 0;
         goto LoadModule_fail;
     }
     ret = NewModuleDesc(name);
     if (!ret) {
         if (errmaj)
             *errmaj = LDR_NOMEM;
-        if (errmin)
-            *errmin = 0;
         goto LoadModule_fail;
     }
 
@@ -855,8 +738,6 @@ LoadModule(const char *module, const char **subdirlist,
         /* This could be a malloc failure too */
         if (errmaj)
             *errmaj = LDR_BADUSAGE;
-        if (errmin)
-            *errmin = 1;
         goto LoadModule_fail;
     }
 
@@ -868,7 +749,7 @@ LoadModule(const char *module, const char **subdirlist,
         found = xstrdup(module);
     path_elem = pathlist;
     while (!found && *path_elem != NULL) {
-        found = FindModule(m, *path_elem, subdirlist, patterns);
+        found = FindModule(m, *path_elem, patterns);
         path_elem++;
         /*
          * When the module name isn't the canonical name, search for the
@@ -887,11 +768,9 @@ LoadModule(const char *module, const char **subdirlist,
         LogMessage(X_WARNING, "Warning, couldn't open module %s\n", module);
         if (errmaj)
             *errmaj = LDR_NOENT;
-        if (errmin)
-            *errmin = 0;
         goto LoadModule_fail;
     }
-    ret->handle = LoaderOpen(found, errmaj, errmin);
+    ret->handle = LoaderOpen(found, errmaj);
     if (ret->handle == NULL)
         goto LoadModule_fail;
     ret->path = strdup(found);
@@ -909,8 +788,6 @@ LoadModule(const char *module, const char **subdirlist,
         p = NULL;
         if (errmaj)
             *errmaj = LDR_NOMEM;
-        if (errmin)
-            *errmin = 0;
         goto LoadModule_fail;
     }
     initdata = LoaderSymbolFromModule(ret->handle, p);
@@ -927,8 +804,6 @@ LoadModule(const char *module, const char **subdirlist,
             if (!CheckVersion(module, vers, modreq)) {
                 if (errmaj)
                     *errmaj = LDR_MISMATCH;
-                if (errmin)
-                    *errmin = 0;
                 goto LoadModule_fail;
             }
         }
@@ -937,8 +812,6 @@ LoadModule(const char *module, const char **subdirlist,
                        " version information\n", module);
             if (errmaj)
                 *errmaj = LDR_INVALID;
-            if (errmin)
-                *errmin = 0;
             goto LoadModule_fail;
         }
         if (setup)
@@ -953,12 +826,10 @@ LoadModule(const char *module, const char **subdirlist,
                    "data object.\n", module, p);
         if (errmaj)
             *errmaj = LDR_INVALID;
-        if (errmin)
-            *errmin = 0;
         goto LoadModule_fail;
     }
     if (ret->SetupProc) {
-        ret->TearDownData = ret->SetupProc(ret, options, errmaj, errmin);
+        ret->TearDownData = ret->SetupProc(ret, options, errmaj, NULL);
         if (!ret->TearDownData) {
             goto LoadModule_fail;
         }
commit ba726ba6a73efe1bd19708b058f481f28068a85b
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 14 11:30:02 2016 -0400

    loader: Turn LoaderListDirs into LoaderListDir
    
    Callers only ever use this for a single directory anyway.
    
    While we're at it, also move xf86DriverListFromCompile near its only
    user in the X -configure code (and inline it out of existence), and
    remove LoaderFreeDirList as it's unused (since X -configure is just
    going to exit anyway, none of that code cares about cleanup).
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 3a8f0e1..f03acf3 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -518,82 +518,6 @@ xf86InputDriverlistFromConfig(void)
     return modulearray;
 }
 
-static int
-is_fallback(const char *s)
-{
-    /* later entries are less preferred */
-    const char *fallback[5] = { "modesetting", "fbdev", "vesa",  "wsfb", NULL };
-    int i;
-
-    for (i = 0; fallback[i]; i++)
-	if (strstr(s, fallback[i]))
-	    return i;
-
-    return -1;
-}
-
-static int
-driver_sort(const void *_l, const void *_r)
-{
-    const char *l = *(const char **)_l;
-    const char *r = *(const char **)_r;
-    int left = is_fallback(l);
-    int right = is_fallback(r);
-
-    /* neither is a fallback, asciibetize */
-    if (left == -1 && right == -1)
-	return strcmp(l, r);
-
-    /* left is a fallback */
-    if (left >= 0)
-	return 1;
-
-    /* right is a fallback */
-    if (right >= 0)
-	return -1;
-
-    /* both are fallbacks, which is worse */
-    return left - right;
-}
-
-static void
-fixup_video_driver_list(const char **drivers)
-{
-    const char **end;
-
-    /* walk to the end of the list */
-    for (end = drivers; *end && **end; end++);
-    end--;
-
-    qsort(drivers, end - drivers, sizeof(const char *), driver_sort);
-}
-
-static const char **
-GenerateDriverlist(const char *dirname)
-{
-    const char **ret;
-    const char *subdirs[] = { dirname, NULL };
-    static const char *patlist[] = { "(.*)_drv\\.so", NULL };
-    ret = LoaderListDirs(subdirs, patlist);
-
-    /* fix up the probe order for video drivers */
-    if (strstr(dirname, "drivers") && ret != NULL)
-        fixup_video_driver_list(ret);
-
-    return ret;
-}
-
-const char **
-xf86DriverlistFromCompile(void)
-{
-    static const char **driverlist = NULL;
-
-    if (!driverlist)
-        driverlist = GenerateDriverlist("drivers");
-
-    return driverlist;
-}
-
 static void
 configFiles(XF86ConfFilesPtr fileconf)
 {
diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h
index 23fb383..bbcb252 100644
--- a/hw/xfree86/common/xf86Config.h
+++ b/hw/xfree86/common/xf86Config.h
@@ -61,7 +61,6 @@ typedef struct _ModuleDefault {
  */
 const char **xf86ModulelistFromConfig(void ***);
 const char **xf86DriverlistFromConfig(void);
-const char **xf86DriverlistFromCompile(void);
 const char **xf86InputDriverlistFromConfig(void);
 Bool xf86BuiltinInputDriver(const char *);
 ConfigStatus xf86HandleConfigFile(Bool);
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index e5889b4..f975b98 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -400,14 +400,9 @@ configureModuleSection(void)
 {
     const char **elist, **el;
 
-    /* Find the list of extension modules. */
-    const char *esubdirs[] = {
-        "extensions",
-        NULL
-    };
     parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec);
 
-    elist = LoaderListDirs(esubdirs, NULL);
+    elist = LoaderListDir("extensions", NULL);
     if (elist) {
         for (el = elist; *el; el++) {
             XF86LoadPtr module;
@@ -534,6 +529,70 @@ configureDDCMonitorSection(int screennum)
     return ptr;
 }
 
+static int
+is_fallback(const char *s)
+{
+    /* later entries are less preferred */
+    const char *fallback[5] = { "modesetting", "fbdev", "vesa",  "wsfb", NULL };
+    int i;
+
+    for (i = 0; fallback[i]; i++)
+	if (strstr(s, fallback[i]))
+	    return i;
+
+    return -1;
+}
+
+static int
+driver_sort(const void *_l, const void *_r)
+{
+    const char *l = *(const char **)_l;
+    const char *r = *(const char **)_r;
+    int left = is_fallback(l);
+    int right = is_fallback(r);
+
+    /* neither is a fallback, asciibetize */
+    if (left == -1 && right == -1)
+	return strcmp(l, r);
+
+    /* left is a fallback */
+    if (left >= 0)
+	return 1;
+
+    /* right is a fallback */
+    if (right >= 0)
+	return -1;
+
+    /* both are fallbacks, which is worse */
+    return left - right;
+}
+
+static void
+fixup_video_driver_list(const char **drivers)
+{
+    const char **end;
+
+    /* walk to the end of the list */
+    for (end = drivers; *end && **end; end++);
+    end--;
+
+    qsort(drivers, end - drivers, sizeof(const char *), driver_sort);
+}
+
+static const char **
+GenerateDriverList(void)
+{
+    const char **ret;
+    static const char *patlist[] = { "(.*)_drv\\.so", NULL };
+    ret = LoaderListDir("drivers", patlist);
+
+    /* fix up the probe order for video drivers */
+    if (ret != NULL)
+        fixup_video_driver_list(ret);
+
+    return ret;
+}
+
 void
 DoConfigure(void)
 {
@@ -545,7 +604,7 @@ DoConfigure(void)
     const char **vlist, **vl;
     int *dev2screen;
 
-    vlist = xf86DriverlistFromCompile();
+    vlist = GenerateDriverList();
 
     if (!vlist) {
         ErrorF("Missing output drivers.  Configuration failed.\n");
@@ -784,7 +843,7 @@ DoShowOptions(void)
     char *pSymbol = 0;
     XF86ModuleData *initData = 0;
 
-    if (!(vlist = xf86DriverlistFromCompile())) {
+    if (!(vlist = GenerateDriverList())) {
         ErrorF("Missing output drivers\n");
         goto bail;
     }
diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index eee9a27..65ca2ec 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -85,8 +85,7 @@ unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
 void LoaderResetOptions(void);
 void LoaderSetOptions(unsigned long);
 
-const char **LoaderListDirs(const char **, const char **);
-void LoaderFreeDirList(char **);
+const char **LoaderListDir(const char *, const char **);
 
 /* Options for LoaderSetOptions */
 #define LDR_OPT_ABI_MISMATCH_NONFATAL		0x0001
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 528cc88..ce10974 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -448,13 +448,11 @@ FindModule(const char *module, const char *dirname, const char **subdirlist,
 }
 
 const char **
-LoaderListDirs(const char **subdirlist, const char **patternlist)
+LoaderListDir(const char *subdir, const char **patternlist)
 {
     char buf[PATH_MAX + 1];
     char **pathlist;
     char **elem;
-    const char **subdirs;
-    const char **s;
     PatternPtr patterns = NULL;
     PatternPtr p;
     DIR *d;
@@ -470,62 +468,56 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
 
     if (!(pathlist = defaultPathList))
         return NULL;
-    if (!(subdirs = InitSubdirs(subdirlist)))
-        goto bail;
     if (!(patterns = InitPatterns(patternlist)))
         goto bail;
 
     for (elem = pathlist; *elem; elem++) {
-        for (s = subdirs; *s; s++) {
-            if ((dirlen = strlen(*elem) + strlen(*s)) > PATH_MAX)
-                continue;
-            strcpy(buf, *elem);
-            strcat(buf, *s);
-            fp = buf + dirlen;
-            if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) &&
-                (d = opendir(buf))) {
-                if (buf[dirlen - 1] != '/') {
-                    buf[dirlen++] = '/';
-                    fp++;
-                }
-                while ((dp = readdir(d))) {
-                    if (dirlen + strlen(dp->d_name) > PATH_MAX)
-                        continue;
-                    strcpy(fp, dp->d_name);
-                    if (!(stat(buf, &stat_buf) == 0 &&
-                          S_ISREG(stat_buf.st_mode)))
-                        continue;
-                    for (p = patterns; p->pattern; p++) {
-                        if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 &&
-                            match[1].rm_so != -1) {
-                            len = match[1].rm_eo - match[1].rm_so;
-                            save = listing;
-                            listing = reallocarray(listing, n + 2,
-                                                   sizeof(char *));
-                            if (!listing) {
-                                if (save) {
-                                    save[n] = NULL;
-                                    FreeStringList(save);
-                                }
-                                closedir(d);
-                                goto bail;
-                            }
-                            listing[n] = malloc(len + 1);
-                            if (!listing[n]) {
-                                FreeStringList(listing);
-                                closedir(d);
-                                goto bail;
+        if ((dirlen = strlen(*elem) + strlen(subdir) + 1) > PATH_MAX)
+            continue;
+        strcpy(buf, *elem);
+        strcat(buf, "/");
+        strcat(buf, subdir);
+        fp = buf + dirlen;
+        if (stat(buf, &stat_buf) == 0 && S_ISDIR(stat_buf.st_mode) &&
+            (d = opendir(buf))) {
+            if (buf[dirlen - 1] != '/') {
+                buf[dirlen++] = '/';
+                fp++;
+            }
+            while ((dp = readdir(d))) {
+                if (dirlen + strlen(dp->d_name) > PATH_MAX)
+                    continue;
+                strcpy(fp, dp->d_name);
+                if (!(stat(buf, &stat_buf) == 0 && S_ISREG(stat_buf.st_mode)))
+                    continue;
+                for (p = patterns; p->pattern; p++) {
+                    if (regexec(&p->rex, dp->d_name, 2, match, 0) == 0 &&
+                        match[1].rm_so != -1) {
+                        len = match[1].rm_eo - match[1].rm_so;
+                        save = listing;
+                        listing = reallocarray(listing, n + 2, sizeof(char *));
+                        if (!listing) {
+                            if (save) {
+                                save[n] = NULL;
+                                FreeStringList(save);
                             }
-                            strncpy(listing[n], dp->d_name + match[1].rm_so,
-                                    len);
-                            listing[n][len] = '\0';
-                            n++;
-                            break;
+                            closedir(d);
+                            goto bail;
                         }
+                        listing[n] = malloc(len + 1);
+                        if (!listing[n]) {
+                            FreeStringList(listing);
+                            closedir(d);
+                            goto bail;
+                        }
+                        strncpy(listing[n], dp->d_name + match[1].rm_so, len);
+                        listing[n][len] = '\0';
+                        n++;
+                        break;
                     }
                 }
-                closedir(d);
             }
+            closedir(d);
         }
     }
     if (listing)
@@ -534,16 +526,9 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
 
  bail:
     FreePatterns(patterns);
-    FreeSubdirs(subdirs);
     return (const char **) ret;
 }
 
-void
-LoaderFreeDirList(char **list)
-{
-    FreeStringList(list);
-}
-
 static Bool
 CheckVersion(const char *module, XF86ModuleVersionInfo * data,
              const XF86ModReqInfo * req)
commit c54a9ca152898ec2ffe50f6d5b70d483b85c1c34
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Apr 14 11:17:22 2016 -0400

    loader: Move loader list details to internal header
    
    There's no reason a driver should ever care about this.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 21daf1a..3a8f0e1 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -60,8 +60,8 @@
 #include "globals.h"
 #include "extension.h"
 #include "xf86pciBus.h"
-
 #include "xf86Xinput.h"
+#include "loaderProcs.h"
 
 #include "xkbsrv.h"
 
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 0d7a127..e5889b4 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -40,6 +40,7 @@
 #include "xf86Sbus.h"
 #endif
 #include "misc.h"
+#include "loaderProcs.h"
 
 typedef struct _DevToConfig {
     GDevRec GDev;
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index faea07f..a3b2c93 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -156,8 +156,6 @@ extern _X_EXPORT void *LoadSubModule(void *, const char *, const char **,
 extern _X_EXPORT void UnloadSubModule(void *);
 extern _X_EXPORT void UnloadModule(void *);
 extern _X_EXPORT void *LoaderSymbol(const char *);
-extern _X_EXPORT const char **LoaderListDirs(const char **, const char **);
-extern _X_EXPORT void LoaderFreeDirList(char **);
 extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);
 extern _X_EXPORT Bool LoaderShouldIgnoreABI(void);
 extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass);
diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index ee8a557..eee9a27 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -85,6 +85,9 @@ unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
 void LoaderResetOptions(void);
 void LoaderSetOptions(unsigned long);
 
+const char **LoaderListDirs(const char **, const char **);
+void LoaderFreeDirList(char **);
+
 /* Options for LoaderSetOptions */
 #define LDR_OPT_ABI_MISMATCH_NONFATAL		0x0001
 
commit d55284e8638ede15be851aa8a19a98dbbff0ce20
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Apr 13 16:06:50 2016 -0400

    xfree86: Remove a stray reference to font modules
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 8c8e49e..0d7a127 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -399,10 +399,9 @@ configureModuleSection(void)
 {
     const char **elist, **el;
 
-    /* Find the list of extension & font modules. */
+    /* Find the list of extension modules. */
     const char *esubdirs[] = {
         "extensions",
-        "fonts",
         NULL
     };
     parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec);
commit d7879c46724a36bfd9a3a08e49903d001ffbf93e
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Apr 13 15:58:33 2016 -0400

    xfree86: Fix up some bad indentation
    
    indent(1) gets confused by function-like macros with no trailing
    semicolon, which is fair enough really.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 59d275e..8c8e49e 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -157,7 +157,7 @@ configureInputSection(void)
 {
     XF86ConfInputPtr mouse = NULL;
 
-    parsePrologue(XF86ConfInputPtr, XF86ConfInputRec)
+    parsePrologue(XF86ConfInputPtr, XF86ConfInputRec);
 
     ptr->inp_identifier = xnfstrdup("Keyboard0");
     ptr->inp_driver = xnfstrdup("kbd");
@@ -196,7 +196,7 @@ configureScreenSection(int screennum)
     int i;
     int depths[] = { 1, 4, 8, 15, 16, 24 /*, 32 */  };
     char *tmp;
-    parsePrologue(XF86ConfScreenPtr, XF86ConfScreenRec)
+    parsePrologue(XF86ConfScreenPtr, XF86ConfScreenRec);
 
     XNFasprintf(&tmp, "Screen%d", screennum);
     ptr->scrn_identifier = tmp;
@@ -254,9 +254,9 @@ configureDeviceSection(int screennum)
     int i = 0;
     char *identifier;
 
-    parsePrologue(XF86ConfDevicePtr, XF86ConfDeviceRec)
+    parsePrologue(XF86ConfDevicePtr, XF86ConfDeviceRec);
 
-        /* Move device info to parser structure */
+    /* Move device info to parser structure */
    if (asprintf(&identifier, "Card%d", screennum) == -1)
         identifier = NULL;
     ptr->dev_identifier = identifier;
@@ -326,9 +326,9 @@ configureLayoutSection(void)
 {
     int scrnum = 0;
 
-    parsePrologue(XF86ConfLayoutPtr, XF86ConfLayoutRec)
+    parsePrologue(XF86ConfLayoutPtr, XF86ConfLayoutRec);
 
-        ptr->lay_identifier = "X.org Configured";
+    ptr->lay_identifier = "X.org Configured";
 
     {
         XF86ConfInputrefPtr iptr;
@@ -389,9 +389,9 @@ configureLayoutSection(void)
 static XF86ConfFlagsPtr
 configureFlagsSection(void)
 {
-    parsePrologue(XF86ConfFlagsPtr, XF86ConfFlagsRec)
+    parsePrologue(XF86ConfFlagsPtr, XF86ConfFlagsRec);
 
-        return ptr;
+    return ptr;
 }
 
 static XF86ConfModulePtr
@@ -405,9 +405,9 @@ configureModuleSection(void)
         "fonts",
         NULL
     };
-    parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec)
+    parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec);
 
-        elist = LoaderListDirs(esubdirs, NULL);
+    elist = LoaderListDirs(esubdirs, NULL);
     if (elist) {
         for (el = elist; *el; el++) {
             XF86LoadPtr module;
@@ -427,9 +427,9 @@ configureModuleSection(void)
 static XF86ConfFilesPtr
 configureFilesSection(void)
 {
-    parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec)
+    parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec);
 
-        if (xf86ModulePath)
+    if (xf86ModulePath)
         ptr->file_modulepath = xnfstrdup(xf86ModulePath);
     if (defaultFontPath)
         ptr->file_fontpath = xnfstrdup(defaultFontPath);
@@ -441,7 +441,7 @@ static XF86ConfMonitorPtr
 configureMonitorSection(int screennum)
 {
     char *tmp;
-    parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec)
+    parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec);
 
     XNFasprintf(&tmp, "Monitor%d", screennum);
     ptr->mon_identifier = tmp;
@@ -486,7 +486,7 @@ configureDDCMonitorSection(int screennum)
     int displaySizeLen;
     char *tmp;
 
-    parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec)
+    parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec);
 
     XNFasprintf(&tmp, "Monitor%d", screennum);
     ptr->mon_identifier = tmp;
commit 5c577da5f3a65c68d2ee12e4afca8f20c3e8ccf4
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jul 14 15:42:18 2016 -0400

    xfree86: Remove DriverRec1 compat struct
    
    The idea here is that the driver might have once been old enough to not
    have the driverFunc slot in DriverRec, with the module ABI not having
    changed when it was added. That was ages ago, and drivers always declare
    themselves with DriverRec not DriverRec1, so uninitialized slots will
    simply be zero.
    
    Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index f48af75..b464864 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -79,14 +79,7 @@ xf86AddDriver(DriverPtr driver, void *module, int flags)
     xf86DriverList = xnfreallocarray(xf86DriverList,
                                      xf86NumDrivers, sizeof(DriverPtr));
     xf86DriverList[xf86NumDrivers - 1] = xnfalloc(sizeof(DriverRec));
-    if (flags & HaveDriverFuncs)
-        *xf86DriverList[xf86NumDrivers - 1] = *driver;
-    else {
-        (void) memset(xf86DriverList[xf86NumDrivers - 1], 0, sizeof(DriverRec));
-        (void) memcpy(xf86DriverList[xf86NumDrivers - 1], driver,
-                      sizeof(DriverRec1));
-
-    }
+    *xf86DriverList[xf86NumDrivers - 1] = *driver;
     xf86DriverList[xf86NumDrivers - 1]->module = module;
     xf86DriverList[xf86NumDrivers - 1]->refCount = 0;
 }
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index bfcb75e..74c65ba 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -209,16 +209,6 @@ typedef CARD32 xorgHWFlags;
  */
 struct _DriverRec;
 
-typedef struct {
-    int driverVersion;
-    const char *driverName;
-    void (*Identify) (int flags);
-    Bool (*Probe) (struct _DriverRec * drv, int flags);
-    const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype);
-    void *module;
-    int refCount;
-} DriverRec1;
-
 struct _SymTabRec;
 struct _PciChipsets;
 
commit 2e3ad7e2506d9eb6667a5f229b5213d215451a5a
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Apr 13 15:50:39 2016 -0400

    loader: Remove silly "unspecified" version handling
    
    Everybody using this functionality specifies a major version, which
    makes sense. If you don't care about a minor version, that's equivalent
    to saying you require minor >= 0, so just say so; likewise patch level.
    
    Likewise ABI class is always specified.
    
    Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index ff0e23e..faea07f 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -141,12 +141,6 @@ typedef struct {
     const char *moduleclass;    /* module class */
 } XF86ModReqInfo;
 
-/* values to indicate unspecified fields in XF86ModReqInfo. */
-#define MAJOR_UNSPEC		0xFF
-#define MINOR_UNSPEC		0xFF
-#define PATCH_UNSPEC		0xFFFF
-#define ABI_VERS_UNSPEC		0xFFFFFFFF
-
 #define MODULE_VERSION_NUMERIC(maj, min, patch) \
 	((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
 #define GET_MODULE_MAJOR_VERSION(vers)	(((vers) >> 24) & 0xFF)
diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index 2ff2894..05ee042 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -5293,12 +5293,12 @@ XFree86 common layer.
 		  as follows:
 		      <programlisting>
 typedef struct {
-	CARD8        majorversion;  /* MAJOR_UNSPEC */
-	CARD8        minorversion;  /* MINOR_UNSPEC */
-	CARD16       patchlevel;    /* PATCH_UNSPEC */
-	const char * abiclass;      /* ABI_CLASS_NONE */
-	CARD32       abiversion;    /* ABI_VERS_UNSPEC */
-	const char * moduleclass;   /* MOD_CLASS_NONE */
+	CARD8        majorversion;
+	CARD8        minorversion;
+	CARD16       patchlevel;
+	const char * abiclass;
+	CARD32       abiversion;
+	const char * moduleclass;
 } XF86ModReqInfo;
 			</programlisting>
 
@@ -5323,8 +5323,8 @@ typedef struct {
 				   The module's minor version must be
 				   no less than this value.  This
 				   comparison is only made if
-				   <structfield>majorversion</structfield> is
-				   specified and matches.
+				   <structfield>majorversion</structfield>
+                                   matches.
 			    </para></listitem></varlistentry>
 
 			<varlistentry>
@@ -5333,8 +5333,8 @@ typedef struct {
 				   The module's patchlevel must be no
 				   less than this value.  This comparison
 				   is only made if
-				   <structfield>minorversion</structfield> is
-				   specified and matches.
+				   <structfield>minorversion</structfield>
+				   matches.
 			    </para></listitem></varlistentry>
 
 			<varlistentry>
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 85689be..528cc88 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -617,32 +617,24 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
 
     /* Check against requirements that the caller has specified */
     if (req) {
-        if (req->majorversion != MAJOR_UNSPEC) {
-            if (data->majorversion != req->majorversion) {
-                LogMessageVerb(X_WARNING, 2, "%s: module major version (%d) "
-                               "doesn't match required major version (%d)\n",
-                               module, data->majorversion, req->majorversion);
-                return FALSE;
-            }
-            else if (req->minorversion != MINOR_UNSPEC) {
-                if (data->minorversion < req->minorversion) {
-                    LogMessageVerb(X_WARNING, 2, "%s: module minor version "
-                                   "(%d) is less than the required minor "
-                                   "version (%d)\n", module,
-                                  data->minorversion, req->minorversion);
-                    return FALSE;
-                }
-                else if (data->minorversion == req->minorversion &&
-                         req->patchlevel != PATCH_UNSPEC) {
-                    if (data->patchlevel < req->patchlevel) {
-                        LogMessageVerb(X_WARNING, 2, "%sL module patch level "
-                                       "(%d) is less than the required patch "
-                                       "level (%d)\n", module, data->patchlevel,
-                                       req->patchlevel);
-                        return FALSE;
-                    }
-                }
-            }
+        if (data->majorversion != req->majorversion) {
+            LogMessageVerb(X_WARNING, 2, "%s: module major version (%d) "
+                           "doesn't match required major version (%d)\n",
+                           module, data->majorversion, req->majorversion);
+            return FALSE;
+        }
+        else if (data->minorversion < req->minorversion) {
+            LogMessageVerb(X_WARNING, 2, "%s: module minor version (%d) is "
+                          "less than the required minor version (%d)\n",
+                          module, data->minorversion, req->minorversion);
+            return FALSE;
+        }
+        else if (data->minorversion == req->minorversion &&
+                 data->patchlevel < req->patchlevel) {
+            LogMessageVerb(X_WARNING, 2, "%s: module patch level (%d) "
+                           "is less than the required patch level "
+                           "(%d)\n", module, data->patchlevel, req->patchlevel);
+            return FALSE;
         }
         if (req->moduleclass) {
             if (!data->moduleclass ||
@@ -663,8 +655,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
                 return FALSE;
             }
         }
-        if ((req->abiclass != ABI_CLASS_NONE) &&
-            req->abiversion != ABI_VERS_UNSPEC) {
+        if (req->abiclass != ABI_CLASS_NONE) {
             int reqmaj, reqmin, maj, min;
 
             reqmaj = GET_ABI_MAJOR(req->abiversion);
commit ef533a912d18db31456b29a18c8bced649309565
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Mar 1 08:29:06 2016 -0500

    loader: Remove unused loader error codes and dead enum
    
    The enum has been unused since at least the removal of elfloader.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 7d09a1b..ff0e23e 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -49,13 +49,6 @@
 #define NULL ((void *)0)
 #endif
 
-typedef enum {
-    LD_RESOLV_IFDONE = 0,       /* only check if no more
-                                   delays pending */
-    LD_RESOLV_NOW = 1,          /* finish one delay step */
-    LD_RESOLV_FORCE = 2         /* force checking... */
-} LoaderResolveOptions;
-
 #define DEFAULT_LIST ((char *)-1)
 
 /* Built-in ABI classes.  These definitions must not be changed. */
@@ -92,19 +85,13 @@ typedef enum {
 #define MODULEVENDORSTRING	"X.Org Foundation"
 #endif
 
-/* Error return codes for errmaj.  New codes must only be added at the end. */
+/* Error return codes for errmaj */
 typedef enum {
     LDR_NOERROR = 0,
     LDR_NOMEM,                  /* memory allocation failed */
     LDR_NOENT,                  /* Module file does not exist */
-    LDR_NOSUBENT,               /* pre-requsite file to be sub-loaded does not exist */
-    LDR_NOSPACE,                /* internal module array full */
-    LDR_NOMODOPEN,              /* module file could not be opened (check errmin) */
-    LDR_UNKTYPE,                /* file is not a recognized module type */
     LDR_NOLOAD,                 /* type specific loader failed */
     LDR_ONCEONLY,               /* Module should only be loaded once (not an error) */
-    LDR_NOPORTOPEN,             /* could not open port (check errmin) */
-    LDR_NOHARDWARE,             /* could not query/initialize the hardware device */
     LDR_MISMATCH,               /* the module didn't match the spec'd requirments */
     LDR_BADUSAGE,               /* LoadModule is called with bad arguments */
     LDR_INVALID,                /* The module doesn't have a valid ModuleData object */
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index d326d9d..85689be 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -1094,18 +1094,6 @@ LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin)
     case LDR_NOENT:
         msg = "module does not exist";
         break;
-    case LDR_NOSUBENT:
-        msg = "a required submodule could not be loaded";
-        break;
-    case LDR_NOSPACE:
-        msg = "too many modules";
-        break;
-    case LDR_NOMODOPEN:
-        msg = "open failed";
-        break;
-    case LDR_UNKTYPE:
-        msg = "unknown module type";
-        break;
     case LDR_NOLOAD:
         msg = "loader failed";
         break;
@@ -1113,12 +1101,6 @@ LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin)
         msg = "already loaded";
         type = X_INFO;
         break;
-    case LDR_NOPORTOPEN:
-        msg = "port open failed";
-        break;
-    case LDR_NOHARDWARE:
-        msg = "no hardware found";
-        break;
     case LDR_MISMATCH:
         msg = "module requirement mismatch";
         break;
commit 7e3cccf8e4426a4b25a7a94d52775d334693572f
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Apr 13 14:59:27 2016 -0400

    loader: Include fewer headers from xf86Module.h
    
    This looks like more, but only if you don't compare it to the number
    pulled in by misc.h.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index cd4227a..7d09a1b 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -41,8 +41,10 @@
 #ifndef _XF86MODULE_H
 #define _XF86MODULE_H
 
-#include "misc.h"
-#include "extension.h"
+#include <X11/Xfuncproto.h>
+#include <X11/Xdefs.h>
+#include <X11/Xmd.h>
+
 #ifndef NULL
 #define NULL ((void *)0)
 #endif
commit 49fa76801348f6d044128f7ec743693d0759d683
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 5 11:01:30 2015 -0400

    loader: Don't add internal/ to the search path
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 95a37fc..d326d9d 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -177,7 +177,6 @@ static const char *stdSubdirs[] = {
     "input/",
     "drivers/",
     "extensions/",
-    "internal/",
     NULL
 };
 
commit 97bd6e453676516891250389ec0fd695c110087c
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 5 10:58:20 2015 -0400

    loader: Remove *GetOS
    
    This API is dumb.  uname(3) exists, feel free to use it, but ideally
    write to the interface not to the OS.  There are a couple of drivers
    using this API, they could all reasonably just not.
    
    This also removes the OS name from the loader subdirectory path search.
    Having /usr/lib/xorg shared across OSes is a non-goal here.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index f724688..828bff1 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -343,8 +343,6 @@ xf86SetSilkenMouse(ScreenPtr pScreen);
 extern _X_EXPORT void *
 xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, const char *port_name,
                   const char **adaptor_name, void **adaptor_options);
-extern _X_EXPORT void
-xf86GetOS(const char **name, int *major, int *minor, int *teeny);
 extern _X_EXPORT ScrnInfoPtr
 xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
                    int entityIndex, EntityProc init,
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 9388436..f48af75 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1752,10 +1752,6 @@ xf86FindXvOptions(ScrnInfoPtr pScrn, int adaptor_index, const char *port_name,
     return NULL;
 }
 
-/* Rather than duplicate loader's get OS function, just include it directly */
-#define LoaderGetOS xf86GetOS
-#include "loader/os.c"
-
 static void
 xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
                            EntityProc enter, EntityProc leave, void *private)
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index e0212cf..cd4227a 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -176,8 +176,6 @@ extern _X_EXPORT void *LoaderSymbol(const char *);
 extern _X_EXPORT const char **LoaderListDirs(const char **, const char **);
 extern _X_EXPORT void LoaderFreeDirList(char **);
 extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);
-extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor,
-                                  int *teeny);
 extern _X_EXPORT Bool LoaderShouldIgnoreABI(void);
 extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass);
 
diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 9218cab..3529a7a 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -14,7 +14,6 @@ EXTRA_DIST = \
 libloader_la_SOURCES = \
 	loader.c \
 	loaderProcs.h \
-        loadmod.c \
-	os.c
+        loadmod.c
 
 libloader_la_LIBADD = $(DLOPEN_LIBS)
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 03c9966..95a37fc 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -269,9 +269,7 @@ InitSubdirs(const char **subdirlist)
     const char **tmp_subdirlist = NULL;
     char **subdirs = NULL;
     const char **s, **stmp = NULL;
-    const char *osname;
-    const char *slash;
-    int oslen = 0, len;
+    int len;
     Bool indefault;
 
     if (subdirlist == NULL) {
@@ -282,9 +280,6 @@ InitSubdirs(const char **subdirlist)
         subdirlist[1] = NULL;
     }
 
-    LoaderGetOS(&osname, NULL, NULL, NULL);
-    oslen = strlen(osname);
-
     {
         /* Count number of entries and check for invalid paths */
         for (i = 0, s = subdirlist; *s; i++, s++) {
@@ -323,12 +318,8 @@ InitSubdirs(const char **subdirlist)
             }
             len = strlen(*s);
             if (**s && (*s)[len - 1] != '/') {
-                slash = "/";
                 len++;
             }
-            else
-                slash = "";
-            len += oslen + 2;
             if (!(subdirs[i] = malloc(len))) {
                 while (--i >= 0)
                     free(subdirs[i]);
@@ -336,9 +327,6 @@ InitSubdirs(const char **subdirlist)
                 free(tmp_subdirlist);
                 return NULL;
             }
-            /* tack on the OS name */
-            sprintf(subdirs[i], "%s%s%s/", *s, slash, osname);
-            i++;
             /* path as given */
             subdirs[i] = strdup(*s);
             i++;
diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c
deleted file mode 100644
index 8d03721..0000000
--- a/hw/xfree86/loader/os.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1999-2002 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "loaderProcs.h"
-
-/*
- * OSNAME is a standard form of the OS name that may be used by the
- * loader and by OS-specific modules.  OSNAME here is different from what's in
- * dix-config.h
- */
-
-#undef OSNAME
-#if defined(__linux__)
-#define OSNAME "linux"
-#elif defined(__FreeBSD__)
-#define OSNAME "freebsd"
-#elif defined(__DragonFly__)
-#define OSNAME "dragonfly"
-#elif defined(__NetBSD__)
-#define OSNAME "netbsd"
-#elif defined(__OpenBSD__)
-#define OSNAME "openbsd"
-#elif defined(__GNU__)
-#define OSNAME "hurd"
-#elif defined(SVR4) && defined(__sun)
-#define OSNAME "solaris"
-#elif defined(SVR5)
-#define OSNAME "svr5"
-#elif defined(SVR4)
-#define OSNAME "svr4"
-#else
-#define OSNAME "unknown"
-#endif
-
-/* Return the OS name, and run-time OS version */
-
-void
-LoaderGetOS(const char **name, int *major, int *minor, int *teeny)
-{
-    if (name)
-        *name = OSNAME;
-
-    /* reporting runtime versions isn't supported yet */
-}
commit a6fcb15472bb7663ae917f5913bf07b6d3c7f186
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Jun 16 11:30:18 2014 -0400

    loader: Port from xfree86 to dix API
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index c8d7540..fded87b 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -50,21 +50,10 @@
 #include <xorg-config.h>
 #endif
 
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <fcntl.h>
 #include <string.h>
-#include <stdarg.h>
-
 #include "os.h"
 #include "loader.h"
 #include "loaderProcs.h"
-#include "xf86.h"
-#include "xf86Priv.h"
 
 #ifdef HAVE_DLFCN_H
 
@@ -80,20 +69,20 @@ extern void *xorg_symbols[];
 void
 LoaderInit(void)
 {
-    xf86MsgVerb(X_INFO, 2, "Loader magic: %p\n", (void *) xorg_symbols);
-    xf86MsgVerb(X_INFO, 2, "Module ABI versions:\n");
-    xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC,
-                   GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion),
-                   GET_ABI_MINOR(LoaderVersionInfo.ansicVersion));
-    xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV,
-                   GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion),
-                   GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion));
-    xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT,
-                   GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion),
-                   GET_ABI_MINOR(LoaderVersionInfo.xinputVersion));
-    xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION,
-                   GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion),
-                   GET_ABI_MINOR(LoaderVersionInfo.extensionVersion));
+    LogMessageVerb(X_INFO, 2, "Loader magic: %p\n", (void *) xorg_symbols);
+    LogMessageVerb(X_INFO, 2, "Module ABI versions:\n");
+    LogWrite(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC,
+             GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion),
+             GET_ABI_MINOR(LoaderVersionInfo.ansicVersion));
+    LogWrite(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV,
+             GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion),
+             GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion));
+    LogWrite(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT,
+             GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion),
+             GET_ABI_MINOR(LoaderVersionInfo.xinputVersion));
+    LogWrite(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION,
+             GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion),
+             GET_ABI_MINOR(LoaderVersionInfo.extensionVersion));
 
 }
 
@@ -108,10 +97,10 @@ LoaderOpen(const char *module, int *errmaj, int *errmin)
     ErrorF("LoaderOpen(%s)\n", module);
 #endif
 
-    xf86Msg(X_INFO, "Loading %s\n", module);
+    LogMessage(X_INFO, "Loading %s\n", module);
 
     if (!(ret = dlopen(module, RTLD_LAZY | RTLD_GLOBAL))) {
-        xf86Msg(X_ERROR, "Failed to load %s: %s\n", module, dlerror());
+        LogMessage(X_ERROR, "Failed to load %s: %s\n", module, dlerror());
         if (errmaj)
             *errmaj = LDR_NOLOAD;
         if (errmin)
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index fd61a82..03c9966 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -51,18 +51,11 @@
 #endif
 
 #include "os.h"
-/* For stat() and related stuff */
-#define NO_OSLIB_PROTOTYPES
-#include "xf86_OSlib.h"
-#define LOADERDECLARATIONS
 #include "loaderProcs.h"
-#include "misc.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Xinput.h"
+#include "xf86Module.h"
 #include "loader.h"
-#include "xf86Optrec.h"
 
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <regex.h>
 #include <dirent.h>
@@ -307,7 +300,7 @@ InitSubdirs(const char **subdirlist)
                  */
                 if (**s == '/' || **s == '\\' || strchr(*s, ':') ||
                     strstr(*s, "..")) {
-                    xf86Msg(X_ERROR, "InitSubdirs: Bad subdir: \"%s\"\n", *s);
+                    LogMessage(X_ERROR, "InitSubdirs: Bad subdir \"%s\"\n", *s);
                     free(tmp_subdirlist);
                     return NULL;
                 }
@@ -572,22 +565,22 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
     long ver = data->xf86version;
     MessageType errtype;
 
-    xf86Msg(X_INFO, "Module %s: vendor=\"%s\"\n",
-            data->modname ? data->modname : "UNKNOWN!",
-            data->vendor ? data->vendor : "UNKNOWN!");
+    LogMessage(X_INFO, "Module %s: vendor=\"%s\"\n",
+               data->modname ? data->modname : "UNKNOWN!",
+               data->vendor ? data->vendor : "UNKNOWN!");
 
     vercode[0] = ver / 10000000;
     vercode[1] = (ver / 100000) % 100;
     vercode[2] = (ver / 1000) % 100;
     vercode[3] = ver % 1000;
-    xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]);
+    LogWrite(1, "\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]);
     if (vercode[3] != 0)
-        xf86ErrorF(".%d", vercode[3]);
-    xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion,
-               data->minorversion, data->patchlevel);
+        LogWrite(1, ".%d", vercode[3]);
+    LogWrite(1, ", module version = %d.%d.%d\n", data->majorversion,
+             data->minorversion, data->patchlevel);
 
     if (data->moduleclass)
-        xf86ErrorFVerb(2, "\tModule class: %s\n", data->moduleclass);
+        LogWrite(2, "\tModule class: %s\n", data->moduleclass);
 
     ver = -1;
     if (data->abiclass) {
@@ -605,8 +598,8 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
 
         abimaj = GET_ABI_MAJOR(data->abiversion);
         abimin = GET_ABI_MINOR(data->abiversion);
-        xf86ErrorFVerb(2, "\tABI class: %s, version %d.%d\n",
-                       data->abiclass, abimaj, abimin);
+        LogWrite(2, "\tABI class: %s, version %d.%d\n",
+                 data->abiclass, abimaj, abimin);
         if (ver != -1) {
             vermaj = GET_ABI_MAJOR(ver);
             vermin = GET_ABI_MINOR(ver);
@@ -615,10 +608,9 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
                     errtype = X_WARNING;
                 else
                     errtype = X_ERROR;
-                xf86MsgVerb(errtype, 0,
-                            "%s: module ABI major version (%d) doesn't"
-                            " match the server's version (%d)\n",
-                            module, abimaj, vermaj);
+                LogMessageVerb(errtype, 0, "%s: module ABI major version (%d) "
+                               "doesn't match the server's version (%d)\n",
+                               module, abimaj, vermaj);
                 if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL))
                     return FALSE;
             }
@@ -627,10 +619,9 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
                     errtype = X_WARNING;
                 else
                     errtype = X_ERROR;
-                xf86MsgVerb(errtype, 0,
-                            "%s: module ABI minor version (%d) is "
-                            "newer than the server's version "
-                            "(%d)\n", module, abimin, vermin);
+                LogMessageVerb(errtype, 0, "%s: module ABI minor version (%d) "
+                               "is newer than the server's version (%d)\n",
+                               module, abimin, vermin);
                 if (!(LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL))
                     return FALSE;
             }
@@ -641,24 +632,26 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
     if (req) {
         if (req->majorversion != MAJOR_UNSPEC) {
             if (data->majorversion != req->majorversion) {
-                xf86MsgVerb(X_WARNING, 2, "%s: module major version (%d) "
-                            "doesn't match required major version (%d)\n",
-                            module, data->majorversion, req->majorversion);
+                LogMessageVerb(X_WARNING, 2, "%s: module major version (%d) "
+                               "doesn't match required major version (%d)\n",
+                               module, data->majorversion, req->majorversion);
                 return FALSE;
             }
             else if (req->minorversion != MINOR_UNSPEC) {
                 if (data->minorversion < req->minorversion) {
-                    xf86MsgVerb(X_WARNING, 2, "%s: module minor version (%d) "
-                                "is less than the required minor version (%d)\n",
-                                module, data->minorversion, req->minorversion);
+                    LogMessageVerb(X_WARNING, 2, "%s: module minor version "
+                                   "(%d) is less than the required minor "
+                                   "version (%d)\n", module,
+                                  data->minorversion, req->minorversion);
                     return FALSE;
                 }
                 else if (data->minorversion == req->minorversion &&
                          req->patchlevel != PATCH_UNSPEC) {
                     if (data->patchlevel < req->patchlevel) {
-                        xf86MsgVerb(X_WARNING, 2, "%s: module patch level (%d) "
-                                    "is less than the required patch level (%d)\n",
-                                    module, data->patchlevel, req->patchlevel);
+                        LogMessageVerb(X_WARNING, 2, "%sL module patch level "
+                                       "(%d) is less than the required patch "
+                                       "level (%d)\n", module, data->patchlevel,
+                                       req->patchlevel);
                         return FALSE;
                     }
                 }
@@ -667,21 +660,19 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
         if (req->moduleclass) {
             if (!data->moduleclass ||
                 strcmp(req->moduleclass, data->moduleclass)) {
-                xf86MsgVerb(X_WARNING, 2, "%s: Module class (%s) doesn't match "
-                            "the required class (%s)\n",
-                            module,
-                            data->moduleclass ? data->moduleclass : "<NONE>",
-                            req->moduleclass);
+                LogMessageVerb(X_WARNING, 2, "%s: Module class (%s) doesn't "
+                               "match the required class (%s)\n", module,
+                               data->moduleclass ? data->moduleclass : "<NONE>",
+                               req->moduleclass);
                 return FALSE;
             }
         }
         else if (req->abiclass != ABI_CLASS_NONE) {
             if (!data->abiclass || strcmp(req->abiclass, data->abiclass)) {
-                xf86MsgVerb(X_WARNING, 2, "%s: ABI class (%s) doesn't match the "
-                            "required ABI class (%s)\n",
-                            module,
-                            data->abiclass ? data->abiclass : "<NONE>",
-                            req->abiclass);
+                LogMessageVerb(X_WARNING, 2, "%s: ABI class (%s) doesn't match"
+                               " the required ABI class (%s)\n", module,
+                               data->abiclass ? data->abiclass : "<NONE>",
+                               req->abiclass);
                 return FALSE;
             }
         }
@@ -694,16 +685,16 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
             maj = GET_ABI_MAJOR(data->abiversion);
             min = GET_ABI_MINOR(data->abiversion);
             if (maj != reqmaj) {
-                xf86MsgVerb(X_WARNING, 2, "%s: ABI major version (%d) doesn't "
-                            "match the required ABI major version (%d)\n",
-                            module, maj, reqmaj);
+                LogMessageVerb(X_WARNING, 2, "%s: ABI major version (%d) "
+                               "doesn't match the required ABI major version "
+                               "(%d)\n", module, maj, reqmaj);
                 return FALSE;
             }
             /* XXX Maybe this should be the other way around? */
             if (min > reqmin) {
-                xf86MsgVerb(X_WARNING, 2, "%s: module ABI minor version (%d) "
-                            "is newer than that available (%d)\n",
-                            module, min, reqmin);
+                LogMessageVerb(X_WARNING, 2, "%s: module ABI minor version "
+                               "(%d) is newer than that available (%d)\n",
+                               module, min, reqmin);
                 return FALSE;
             }
         }
@@ -727,12 +718,11 @@ LoadSubModule(void *_parent, const char *module,
     ModuleDescPtr submod;
     ModuleDescPtr parent = (ModuleDescPtr) _parent;
 
-    xf86MsgVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module);
+    LogMessageVerb(X_INFO, 3, "Loading sub module \"%s\"\n", module);
 
     if (PathIsAbsolute(module)) {
-        xf86Msg(X_ERROR,
-                "LoadSubModule: Absolute module path not permitted: \"%s\"\n",
-                module);
+        LogMessage(X_ERROR, "LoadSubModule: "
+                   "Absolute module path not permitted: \"%s\"\n", module);
         if (errmaj)
             *errmaj = LDR_BADUSAGE;
         if (errmin)
@@ -857,26 +847,26 @@ LoadModule(const char *module, const char **subdirlist,
     char *m = NULL;
     const char **cim;
 
-    xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module);
+    LogMessageVerb(X_INFO, 3, "LoadModule: \"%s\"", module);
 
     patterns = InitPatterns(patternlist);
     name = LoaderGetCanonicalName(module, patterns);
     noncanonical = (name && strcmp(module, name) != 0);
     if (noncanonical) {
-        xf86ErrorFVerb(3, " (%s)\n", name);
-        xf86MsgVerb(X_WARNING, 1,
-                    "LoadModule: given non-canonical module name \"%s\"\n",
-                    module);
+        LogWrite(3, " (%s)\n", name);
+        LogMessageVerb(X_WARNING, 1,
+                       "LoadModule: given non-canonical module name \"%s\"\n",
+                       module);
         m = name;
     }
     else {
-        xf86ErrorFVerb(3, "\n");
+        LogWrite(3, "\n");
         m = (char *) module;
     }
 
     for (cim = compiled_in_modules; *cim; cim++)
         if (!strcmp(m, *cim)) {
-            xf86MsgVerb(X_INFO, 3, "Module \"%s\" already built-in\n", m);
+            LogMessageVerb(X_INFO, 3, "Module \"%s\" already built-in\n", m);
             ret = (ModuleDescPtr) 1;
             goto LoadModule_exit;
         }
@@ -931,7 +921,7 @@ LoadModule(const char *module, const char **subdirlist,
      * did we find the module?
      */
     if (!found) {
-        xf86Msg(X_WARNING, "Warning, couldn't open module %s\n", module);
+        LogMessage(X_WARNING, "Warning, couldn't open module %s\n", module);
         if (errmaj)
             *errmaj = LDR_NOENT;
         if (errmin)
@@ -980,9 +970,8 @@ LoadModule(const char *module, const char **subdirlist,
             }
         }
         else {
-            xf86Msg(X_ERROR,
-                    "LoadModule: Module %s does not supply"
-                    " version information\n", module);
+            LogMessage(X_ERROR, "LoadModule: Module %s does not supply"
+                       " version information\n", module);
             if (errmaj)
                 *errmaj = LDR_INVALID;
             if (errmin)
@@ -997,8 +986,8 @@ LoadModule(const char *module, const char **subdirlist,
     }
     else {
         /* no initdata, fail the load */
-        xf86Msg(X_ERROR, "LoadModule: Module %s does not have a %s "
-                "data object.\n", module, p);
+        LogMessage(X_ERROR, "LoadModule: Module %s does not have a %s "
+                   "data object.\n", module, p);
         if (errmaj)
             *errmaj = LDR_INVALID;
         if (errmin)
@@ -1012,8 +1001,8 @@ LoadModule(const char *module, const char **subdirlist,
         }
     }
     else if (options) {
-        xf86Msg(X_WARNING, "Module Options present, but no SetupProc "
-                "available for %s\n", module);
+        LogMessage(X_WARNING, "Module Options present, but no SetupProc "
+                   "available for %s\n", module);
     }
     goto LoadModule_exit;
 
@@ -1162,11 +1151,11 @@ LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin)
         msg = "unknown error";
     }
     if (name)
-        xf86Msg(type, "%s: Failed to load module \"%s\" (%s, %d)\n",
-                name, modname, msg, errmin);
+        LogMessage(type, "%s: Failed to load module \"%s\" (%s, %d)\n",
+                   name, modname, msg, errmin);
     else
-        xf86Msg(type, "Failed to load module \"%s\" (%s, %d)\n",
-                modname, msg, errmin);
+        LogMessage(type, "Failed to load module \"%s\" (%s, %d)\n",
+                   modname, msg, errmin);
 }
 
 /* Given a module path or file name, return the module's canonical name */
commit 778cfc59762cdf528cf8672bfb5696844e91ebc3
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Sun Apr 17 21:07:30 2016 +0100

    xfree86: flatten pathlist management in the loader
    
    Now that users can set the path only via LoaderSetPath(), we can simplify
    things.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 5e4d7da..fd61a82 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -127,9 +127,6 @@ InitPathList(const char *path)
     int addslash;
     int n = 0;
 
-    if (!path)
-        return defaultPathList;
-
     fullpath = strdup(path);
     if (!fullpath)
         return NULL;
@@ -171,13 +168,6 @@ InitPathList(const char *path)
     return list;
 }
 
-static void
-FreePathList(char **pathlist)
-{
-    if (pathlist && pathlist != defaultPathList)
-        FreeStringList(pathlist);
-}
-
 void
 LoaderSetPath(const char *path)
 {
@@ -498,7 +488,7 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
     char **ret = NULL;
     int n = 0;
 
-    if (!(pathlist = InitPathList(NULL)))
+    if (!(pathlist = defaultPathList))
         return NULL;
     if (!(subdirs = InitSubdirs(subdirlist)))
         goto bail;
@@ -565,7 +555,6 @@ LoaderListDirs(const char **subdirlist, const char **patternlist)
  bail:
     FreePatterns(patterns);
     FreeSubdirs(subdirs);
-    FreePathList(pathlist);
     return (const char **) ret;
 }
 
@@ -908,7 +897,7 @@ LoadModule(const char *module, const char **subdirlist,
         goto LoadModule_fail;
     }
 
-    pathlist = InitPathList(NULL);
+    pathlist = defaultPathList;
     if (!pathlist) {
         /* This could be a malloc failure too */
         if (errmaj)
@@ -1033,7 +1022,6 @@ LoadModule(const char *module, const char **subdirlist,
     ret = NULL;
 
  LoadModule_exit:
-    FreePathList(pathlist);
     FreePatterns(patterns);
     free(found);
     free(name);
commit 7b71055fc65242a9c4b651e72bb07dbb3f00c4e6
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Sun Apr 17 21:07:29 2016 +0100

    xfree86: remove dummy/dead function prototype for LoadDriver
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>

diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index 8d7872f..ee8a557 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -72,8 +72,6 @@ typedef struct module_desc {
 
 void LoaderInit(void);
 
-ModuleDescPtr LoadDriver(const char *, const char *, int, void *, int *,
-                         int *);
 ModuleDescPtr LoadModule(const char *, const char **,
                          const char **, void *, const XF86ModReqInfo *,
                          int *, int *);
commit 57eec704c3ddea0fecea2d8fbd1c3547f0b8fccf
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Sun Apr 17 21:07:27 2016 +0100

    xfree86: remove references to LoadSubModule's path from the doc
    
    Afaics the argument hasn't been part of the API since the documentation
    has been converted to xml with commit fc6ebe1e1d3 "Convert LinuxDoc
    documents to DocBook/XML"
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>

diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index 57f7160..2ff2894 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -5689,11 +5689,7 @@ the server, and may also be used from within modules.
     described above, except that the module loaded is registered as a
     child of the calling module.  The <parameter>parent</parameter> parameter
     is the calling module's handle.  Modules loaded with this function
-    are automatically unloaded when the parent module is unloaded.  The
-    other difference is that the path parameter may not be specified.
-    The module search path used for modules loaded with this function
-    is the default search path as initialised with
-    <function>LoaderSetPath()</function>.
+    are automatically unloaded when the parent module is unloaded.
 	    </para>
 
 	  </blockquote></para></blockquote>
commit 2196bb50383bd96d364f799018c0693c9309ed7f
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Sun Apr 17 21:07:28 2016 +0100

    xfree86: remove unused path from the LoadModule API
    
    Similar to its little brother - LoadSubModule. Currently all call sites
    provide NULL anyway ;-)
    
    Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 6f3a608..9388436 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1615,7 +1615,7 @@ xf86LoadOneModule(const char *name, void *opt)
         return NULL;
     }
 
-    mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin);
+    mod = LoadModule(Name, NULL, NULL, opt, NULL, &errmaj, &errmin);
     if (!mod)
         LoaderErrorMsg(NULL, Name, errmaj, errmin);
     free(Name);
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index a544b65..f6f77c0 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1503,7 +1503,7 @@ xf86LoadModules(const char **list, void **optlist)
         else
             opt = NULL;
 
-        if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin)) {
+        if (!LoadModule(name, NULL, NULL, opt, NULL, &errmaj, &errmin)) {
             LoaderErrorMsg(NULL, name, errmaj, errmin);
             failed = TRUE;
         }
diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index f7d6628..57f7160 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -5210,7 +5210,7 @@ XFree86 common layer.
 
       <blockquote><para>
 	  <programlisting>
-    pointer LoadModule(const char *module, const char *path,
+    pointer LoadModule(const char *module,
                        const char **subdirlist, const char **patternlist,
                        pointer options, const XF86ModReqInfo * modreq,
                        int *errmaj, int *errmin);
@@ -5226,12 +5226,6 @@ XFree86 common layer.
     This might change.  The other parameters are:
 
 	      <variablelist>
-		<varlistentry>
-		  <term><parameter>path</parameter></term>
-		  <listitem><para>
-		  An optional comma-separated list of module search paths.
-		  When <constant>NULL</constant>, the default search path is used.
-		    </para></listitem></varlistentry>
 
 
 		<varlistentry>
diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index cfc4d80..8d7872f 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -74,7 +74,7 @@ void LoaderInit(void);
 
 ModuleDescPtr LoadDriver(const char *, const char *, int, void *, int *,
                          int *);
-ModuleDescPtr LoadModule(const char *, const char *, const char **,
+ModuleDescPtr LoadModule(const char *, const char **,
                          const char **, void *, const XF86ModReqInfo *,
                          int *, int *);
 ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent);
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 940f5fc..5e4d7da 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -751,7 +751,7 @@ LoadSubModule(void *_parent, const char *module,
         return NULL;
     }
 
-    submod = LoadModule(module, NULL, subdirlist, patternlist, options,
+    submod = LoadModule(module, subdirlist, patternlist, options,
                         modreq, errmaj, errmin);
     if (submod && submod != (ModuleDescPtr) 1) {
         parent->child = AddSibling(parent->child, submod);
@@ -821,7 +821,6 @@ static const char *compiled_in_modules[] = {
  * module       The module name.  Normally this is not a filename but the
  *              module's "canonical name.  A full pathname is, however,
  *              also accepted.
- * path         A comma separated list of module directories.
  * subdirlist   A NULL terminated list of subdirectories to search.  When
  *              NULL, the default "stdSubdirs" list is used.  The default
  *              list is also substituted for entries with value DEFAULT_LIST.
@@ -853,7 +852,7 @@ static const char *compiled_in_modules[] = {
  *
  */
 ModuleDescPtr
-LoadModule(const char *module, const char *path, const char **subdirlist,
+LoadModule(const char *module, const char **subdirlist,
            const char **patternlist, void *options,
            const XF86ModReqInfo * modreq, int *errmaj, int *errmin)
 {
@@ -909,7 +908,7 @@ LoadModule(const char *module, const char *path, const char **subdirlist,
         goto LoadModule_fail;
     }
 
-    pathlist = InitPathList(path);
+    pathlist = InitPathList(NULL);
     if (!pathlist) {
         /* This could be a malloc failure too */
         if (errmaj)


More information about the xorg-commit mailing list