ALSA: hda: hda_component: Initialize shared data during bind callback
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Wed, 8 May 2024 10:03:47 +0000 (11:03 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 8 May 2024 16:18:23 +0000 (18:18 +0200)
commitec6f32bc924d1c00cbcd5672510758f7088f2513
tree89f1d42892a7679f7e89dde38d8f14d405b8f0dd
parent172811e3a557d8681a5e2d0f871dc04a2d17eb13
ALSA: hda: hda_component: Initialize shared data during bind callback

Move the initialization of the shared struct hda_component array into
hda_component_manager_bind().

The purpose of the manager bind() callback is to allow it to perform
initialization before binding in the component drivers. This is the
correct place to initialize the shared data.

The original implementation initialized the shared data in
hda_component_manager_init(). This is only done once during probe()
of the manager driver. So if the component binding was unbound and
then rebound, the shared data would not be re-initialized.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: fd895a74dc1d ("ALSA: hda: realtek: Move hda_component implementation to module")
Link: https://lore.kernel.org/r/20240508100347.47283-1-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_component.c
sound/pci/hda/hda_component.h
sound/pci/hda/patch_realtek.c