From a8dca4604a13469892c77c25638691d7757e7a47 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 10 Feb 2014 18:23:57 +0100 Subject: [PATCH] ALSA: hda - Make snd_hda_gen_spec_free() static The last user of snd_hda_gen_spec_free() is patch_via.c, and we can rewrite it safely with snd_hda_gen_free(), so that snd_hda_gen_spec_free() can be a local function in hda_generic.c. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_generic.c | 3 +-- sound/pci/hda/hda_generic.h | 1 - sound/pci/hda/patch_via.c | 8 +------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 0c90eba6ba3d..842ebe93ec19 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -79,7 +79,7 @@ static void free_kctls(struct hda_gen_spec *spec) snd_array_free(&spec->kctls); } -void snd_hda_gen_spec_free(struct hda_gen_spec *spec) +static void snd_hda_gen_spec_free(struct hda_gen_spec *spec) { if (!spec) return; @@ -87,7 +87,6 @@ void snd_hda_gen_spec_free(struct hda_gen_spec *spec) snd_array_free(&spec->paths); snd_array_free(&spec->loopback_list); } -EXPORT_SYMBOL_GPL(snd_hda_gen_spec_free); /* * store user hints diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index 07f767231c9f..9b2cbf8c1eb4 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h @@ -296,7 +296,6 @@ struct hda_gen_spec { }; int snd_hda_gen_spec_init(struct hda_gen_spec *spec); -void snd_hda_gen_spec_free(struct hda_gen_spec *spec); int snd_hda_gen_init(struct hda_codec *codec); void snd_hda_gen_free(struct hda_codec *codec); diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index f84195f3ea31..778166259b3e 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -465,14 +465,8 @@ static void via_playback_pcm_hook(struct hda_pcm_stream *hinfo, static void via_free(struct hda_codec *codec) { - struct via_spec *spec = codec->spec; - - if (!spec) - return; - vt1708_stop_hp_work(codec); - snd_hda_gen_spec_free(&spec->gen); - kfree(spec); + snd_hda_gen_free(codec); } #ifdef CONFIG_PM -- GitLab