提交 ff7a3267 编写于 作者: T Takashi Iwai

ALSA: hda - Don't export symbols when built-in kernel

The global functions in hda_codec.c and other core parts are only
for HD-audio codec and controller drivers.  When the HD-audio driver
is built in kernel, all stuff have to be statically linked, thus
we don't need any exports.

This patch introduces a conditional macro to do export only
when needed.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 645f10c1
...@@ -128,7 +128,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) ...@@ -128,7 +128,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); INIT_WORK(&beep->beep_work, &snd_hda_generate_beep);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_attach_beep_device); EXPORT_SYMBOL_HDA(snd_hda_attach_beep_device);
void snd_hda_detach_beep_device(struct hda_codec *codec) void snd_hda_detach_beep_device(struct hda_codec *codec)
{ {
...@@ -141,4 +141,4 @@ void snd_hda_detach_beep_device(struct hda_codec *codec) ...@@ -141,4 +141,4 @@ void snd_hda_detach_beep_device(struct hda_codec *codec)
kfree(beep); kfree(beep);
} }
} }
EXPORT_SYMBOL_GPL(snd_hda_detach_beep_device); EXPORT_SYMBOL_HDA(snd_hda_detach_beep_device);
此差异已折叠。
...@@ -905,4 +905,19 @@ static inline void snd_hda_power_down(struct hda_codec *codec) {} ...@@ -905,4 +905,19 @@ static inline void snd_hda_power_down(struct hda_codec *codec) {}
#define snd_hda_codec_needs_resume(codec) 1 #define snd_hda_codec_needs_resume(codec) 1
#endif #endif
/*
* Codec modularization
*/
/* Export symbols only for communication with codec drivers;
* When built in kernel, all HD-audio drivers are supposed to be statically
* linked to the kernel. Thus, the symbols don't have to (or shouldn't) be
* exported unless it's built as a module.
*/
#ifdef MODULE
#define EXPORT_SYMBOL_HDA(sym) EXPORT_SYMBOL_GPL(sym)
#else
#define EXPORT_SYMBOL_HDA(sym)
#endif
#endif /* __SOUND_HDA_CODEC_H */ #endif /* __SOUND_HDA_CODEC_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册