SND/PCI/HDA: add __init to snd_hda_add_codec_preset
PATCH 1/1 SND/PCI/HDA: add __init to snd_hda_add_codec_preset
snd_hda_add_codec_preset is only called by __init functions:
__init patch_via_init__init patch_sigmatel_init__init patch_si3054_init__init patch_realtek_init__init patch_hdmi_init__init patch_conexant_init__init patch_cmedia_init__init patch_cirrus_init__init patch_ca0132_init__init patch_ca0110_init__init patch_analog_init
--- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/hda_codec.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/pci/hda/hda_codec.c +1 -1
@@ -77,7 +77,7 @@ static struct hda_vendor_id hda_vendor_ids[] = {static DEFINE_MUTEX (preset_mutex);static LIST_HEAD (hda_preset_tables); -int snd_hda_add_codec_preset (struct hda_codec_preset_list *preset) +int __init snd_hda_add_codec_preset (struct hda_codec_preset_list *preset) {mutex_lock (&preset_mutex);list_add_tail (&preset->list, &hda_preset_tables);
sound/pci/hda/hda_codec.h +1 -1
@@ -182,7 +182,7 @@ struct hda_codec_preset_list { };/* initial hook */ -int snd_hda_add_codec_preset (struct hda_codec_preset_list *preset); +int __init snd_hda_add_codec_preset (struct hda_codec_preset_list *preset);int snd_hda_delete_codec_preset (struct hda_codec_preset_list *preset);/* ops set by the preset patch */
Signature · 1 line
1.8.4.5
At Mon, 9 Jun 2014 16:23:32 +0200,
Quoted 15 lines · Fabian Frederick
snd_hda_add_codec_presetis only called by__initfunctions:
__initpatch_via_init__initpatch_sigmatel_init__initpatch_si3054_init__initpatch_realtek_init__initpatch_hdmi_init__initpatch_conexant_init__initpatch_cmedia_init__initpatch_cirrus_init__initpatch_ca0132_init__initpatch_ca0110_init__initpatch_analog_init
Quoted 3 lines
Cc Jaroslav Kysela <[email protected]>Cc Takashi Iwai <[email protected]>Signed-off-by Fabian Frederick <[email protected]>
No, it's a wrong guess. Each module may be called at any time, so you can't use __init for helper functions.
thanks,
Takashi
Quoted 34 lines
--- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/hda_codec.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)sound/pci/hda/hda_codec.c +1
-1@@ -77,7 +77,7 @@ static struct hda_vendor_id hda_vendor_ids[] = {static DEFINE_MUTEX (preset_mutex);static LIST_HEAD (hda_preset_tables); -int snd_hda_add_codec_preset (struct hda_codec_preset_list *preset) +int __init snd_hda_add_codec_preset (struct hda_codec_preset_list *preset) {mutex_lock (&preset_mutex);list_add_tail (&preset->list, &hda_preset_tables);sound/pci/hda/hda_codec.h +1
-1@@ -182,7 +182,7 @@ struct hda_codec_preset_list { };/* initial hook */ -int snd_hda_add_codec_preset (struct hda_codec_preset_list *preset); +int __init snd_hda_add_codec_preset (struct hda_codec_preset_list *preset);int snd_hda_delete_codec_preset (struct hda_codec_preset_list *preset);/* ops set by the preset patch */ Signature · 1 line
1.8.4.5
Quoted 17 lines · On Tue, 10 Jun 2014 15:55:26 +0200 Takashi Iwai <[email protected]> wrote:
At Mon, 9 Jun 2014 16:23:32 +0200,
Quoted 15 lines · Fabian Frederick
snd_hda_add_codec_presetis only called by__initfunctions:
__initpatch_via_init__initpatch_sigmatel_init__initpatch_si3054_init__initpatch_realtek_init__initpatch_hdmi_init__initpatch_conexant_init__initpatch_cmedia_init__initpatch_cirrus_init__initpatch_ca0132_init__initpatch_ca0110_init__initpatch_analog_init
Quoted 6 lines
Quoted 3 lines
Cc Jaroslav Kysela <[email protected]>Cc Takashi Iwai <[email protected]>Signed-off-by Fabian Frederick <[email protected]>No, it's a wrong guess. Each module may be called at any time, so you can't use
__initfor helper functions.
Sorry but I don't understand what you mean by "calling at any time". AFAIK __init prefix only impacts built-in drivers.
Regards,
Fabian
Quoted 40 lines
thanks,
Takashi
Quoted 34 lines
--- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/hda_codec.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)sound/pci/hda/hda_codec.c +1
-1@@ -77,7 +77,7 @@ static struct hda_vendor_id hda_vendor_ids[] = {static DEFINE_MUTEX (preset_mutex);static LIST_HEAD (hda_preset_tables); -int snd_hda_add_codec_preset (struct hda_codec_preset_list *preset) +int __init snd_hda_add_codec_preset (struct hda_codec_preset_list *preset) {mutex_lock (&preset_mutex);list_add_tail (&preset->list, &hda_preset_tables);sound/pci/hda/hda_codec.h +1
-1@@ -182,7 +182,7 @@ struct hda_codec_preset_list { };/* initial hook */ -int snd_hda_add_codec_preset (struct hda_codec_preset_list *preset); +int __init snd_hda_add_codec_preset (struct hda_codec_preset_list *preset);int snd_hda_delete_codec_preset (struct hda_codec_preset_list *preset);/* ops set by the preset patch */ Signature · 1 line
1.8.4.5