summaryrefslogtreecommitdiff
path: root/include/linux/init.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@mandrakesoft.com>2002-08-04 03:29:22 -0400
committerJeff Garzik <jgarzik@mandrakesoft.com>2002-08-04 03:29:22 -0400
commita77c17643928df397eda8a492d3c50392504bc16 (patch)
treea97cefc1ee2c8724aa6ea1e18af6909ba1410068 /include/linux/init.h
parent35aa61ec011d8712717362550cd0008bcc7d99e8 (diff)
Macro __devexit_p in linux/init.h needs to be conditions on both
MODULE and CONFIG_HOTPLUG cpp symbols. Merge 2.4's definition to make it so.
Diffstat (limited to 'include/linux/init.h')
-rw-r--r--include/linux/init.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/init.h b/include/linux/init.h
index b45b95c5e640..42300a7371af 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -177,13 +177,23 @@ typedef void (*__cleanup_module_func_t)(void);
#define __devinitdata
#define __devexit
#define __devexitdata
-#define __devexit_p(x) &(x)
#else
#define __devinit __init
#define __devinitdata __initdata
#define __devexit __exit
#define __devexitdata __exitdata
-#define __devexit_p(x) 0
+#endif
+
+/* Functions marked as __devexit may be discarded at kernel link time, depending
+ on config options. Newer versions of binutils detect references from
+ retained sections to discarded sections and flag an error. Pointers to
+ __devexit functions must use __devexit_p(function_name), the wrapper will
+ insert either the function_name or NULL, depending on the config options.
+ */
+#if defined(MODULE) || defined(CONFIG_HOTPLUG)
+#define __devexit_p(x) x
+#else
+#define __devexit_p(x) NULL
#endif
#endif /* _LINUX_INIT_H */