summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <hramrach@centrum.cz>2011-10-08 14:19:34 +0200
committerMichal Suchanek <hramrach@centrum.cz>2011-10-18 13:18:33 +0200
commit24d435163eb5fbd9b73cd8ba13a9b3cdbbe8a1df (patch)
tree1fa9f2813a614f55dcd5a0c69b479497ca76d179
parent0d4bb5442ceb8e8e4a8de6cfc4203cae469eee72 (diff)
Use UnloadModuleOrDriver for UnloadSubModule.
Signed-off-by: Michal Suchanek <hramrach@centrum.cz> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--hw/xfree86/loader/loadmod.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 9f820993a..2e6c667c2 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -1072,7 +1072,10 @@ UnloadModuleOrDriver(ModuleDescPtr mod)
if (mod == NULL || mod->name == NULL)
return;
- xf86MsgVerb(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name);
+ if (mod->parent)
+ xf86MsgVerb(X_INFO, 3, "UnloadSubModule: \"%s\"\n", mod->name);
+ else
+ xf86MsgVerb(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name);
if ((mod->TearDownProc) && (mod->TearDownData))
mod->TearDownProc(mod->TearDownData);
@@ -1092,23 +1095,8 @@ UnloadSubModule(pointer _mod)
{
ModuleDescPtr mod = (ModuleDescPtr)_mod;
- if (mod == NULL || mod->name == NULL)
- return;
-
- xf86MsgVerb(X_INFO, 3, "UnloadSubModule: \"%s\"\n", mod->name);
-
- if ((mod->TearDownProc) && (mod->TearDownData))
- mod->TearDownProc(mod->TearDownData);
- LoaderUnload(mod->name, mod->handle);
-
RemoveChild(mod);
-
- if (mod->child)
- UnloadModuleOrDriver(mod->child);
-
- free(mod->path);
- free(mod->name);
- free(mod);
+ UnloadModuleOrDriver(mod);
}
static void
@@ -1135,6 +1123,7 @@ RemoveChild(ModuleDescPtr child)
}
if (mdp == child)
prevsib->sib = child->sib;
+ child->sib = NULL;
return;
}