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: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 586ea08..6612d0f 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -905,4 +905,19 @@
 #define snd_hda_codec_needs_resume(codec) 1
 #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 */