Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff7a3267 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 645f10c1
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -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)
		kfree(beep);
		kfree(beep);
	}
	}
}
}
EXPORT_SYMBOL_GPL(snd_hda_detach_beep_device);
EXPORT_SYMBOL_HDA(snd_hda_detach_beep_device);
+74 −74

File changed.

Preview size limit exceeded, changes collapsed.

+15 −0
Original line number Original line Diff line number Diff line
@@ -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 */