]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/module.c
module: remove module_text_address()
[karo-tx-linux.git] / kernel / module.c
index bd15a94f91c10f2394cbf0fad307911716a761dd..8ddca629e07942631e3eaa6e7cf7c875c328792e 100644 (file)
@@ -908,8 +908,10 @@ void symbol_put_addr(void *addr)
        if (core_kernel_text((unsigned long)addr))
                return;
 
-       if (!(modaddr = module_text_address((unsigned long)addr)))
-               BUG();
+       /* module_text_address is safe here: we're supposed to have reference
+        * to module from symbol_get, so it can't go away. */
+       modaddr = __module_text_address((unsigned long)addr);
+       BUG_ON(!modaddr);
        module_put(modaddr);
 }
 EXPORT_SYMBOL_GPL(symbol_put_addr);
@@ -2821,17 +2823,6 @@ struct module *__module_text_address(unsigned long addr)
        return mod;
 }
 
-struct module *module_text_address(unsigned long addr)
-{
-       struct module *mod;
-
-       preempt_disable();
-       mod = __module_text_address(addr);
-       preempt_enable();
-
-       return mod;
-}
-
 /* Don't grab lock, we're oopsing. */
 void print_modules(void)
 {