diff mbox series

[9/9] ALSA: hda/realtek: Remove redundant init_hook() in alc_default_init()

Message ID 20220706120230.427296-10-cezary.rojewski@intel.com (mailing list archive)
State New, archived
Headers show
Series ALSA: hda: Codec-reload bug fixes and cleanups | expand

Commit Message

Cezary Rojewski July 6, 2022, 12:02 p.m. UTC
snd_hda_gen_init() does that for every codec already.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/pci/hda/patch_realtek.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Takashi Iwai July 9, 2022, 4:46 p.m. UTC | #1
On Wed, 06 Jul 2022 14:02:30 +0200,
Cezary Rojewski wrote:
> 
> snd_hda_gen_init() does that for every codec already.

Definitely not.

snd_hda_gen_init() calls init_hook of snd_hda_gen_spec.

OTOH, what you're trying to kill the init_hook call of alc_spec.
Both are in different layers and they don't share the same callback.


thanks,

Takashi

> 
> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
> ---
>  sound/pci/hda/patch_realtek.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index f3ad454b3fbf..a8688025352d 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -923,9 +923,6 @@ static int alc_init(struct hda_codec *codec)
>  	if (is_s4_resume(codec))
>  		alc_pre_init(codec);
>  
> -	if (spec->init_hook)
> -		spec->init_hook(codec);
> -
>  	spec->gen.skip_verbs = 1; /* applied in below */
>  	snd_hda_gen_init(codec);
>  	alc_fix_pll(codec);
> -- 
> 2.25.1
>
Cezary Rojewski July 11, 2022, 8:12 a.m. UTC | #2
On 2022-07-09 6:46 PM, Takashi Iwai wrote:
> On Wed, 06 Jul 2022 14:02:30 +0200,
> Cezary Rojewski wrote:
>>
>> snd_hda_gen_init() does that for every codec already.
> 
> Definitely not.
> 
> snd_hda_gen_init() calls init_hook of snd_hda_gen_spec.
> 
> OTOH, what you're trying to kill the init_hook call of alc_spec.
> Both are in different layers and they don't share the same callback.


I see the mistake now. This patch was generated when I was debugging one 
of the module-reload issues, and once it was fixed, double ->init_hook() 
caught my eye so I decided to add additional cleanup patch on top. Meh.

Thanks for paying attention and good review!


Regards,
Czarek
diff mbox series

Patch

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index f3ad454b3fbf..a8688025352d 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -923,9 +923,6 @@  static int alc_init(struct hda_codec *codec)
 	if (is_s4_resume(codec))
 		alc_pre_init(codec);
 
-	if (spec->init_hook)
-		spec->init_hook(codec);
-
 	spec->gen.skip_verbs = 1; /* applied in below */
 	snd_hda_gen_init(codec);
 	alc_fix_pll(codec);