定义是:
#if defined(MODULE) || defined(CONFIG_HOTPLUG) //可见这是要根据.config文件的内容来确定的。MODULE 和 CONFIG_HOTPLUG 都没有定义 ,name就等于是个NULL指针
#define __devexit_p(x) x
#else
#define __devexit_p(x) NULL
#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.
*/
内核注释里说:
被“__devexit” 标记的东西,可能在内核链接的时候被丢弃,是否丢弃取决于 config 选项。
有 “__devexit” 的函数指针,必须使用 __devexit_p(function_name) 的形式。 当然,有可能最终是函数名,也有可能被替换成了 NULL