diff options
author | Richard Fitzgerald <rf@opensource.cirrus.com> | 2024-05-08 13:03:47 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2024-05-08 19:18:23 +0300 |
commit | ec6f32bc924d1c00cbcd5672510758f7088f2513 (patch) | |
tree | 89f1d42892a7679f7e89dde38d8f14d405b8f0dd /sound/pci/hda/hda_component.h | |
parent | 172811e3a557d8681a5e2d0f871dc04a2d17eb13 (diff) | |
download | linux-ec6f32bc924d1c00cbcd5672510758f7088f2513.tar.xz |
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>
Diffstat (limited to 'sound/pci/hda/hda_component.h')
-rw-r--r-- | sound/pci/hda/hda_component.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_component.h b/sound/pci/hda/hda_component.h index c80a66691b5d..c70b3de68ab2 100644 --- a/sound/pci/hda/hda_component.h +++ b/sound/pci/hda/hda_component.h @@ -75,11 +75,8 @@ int hda_component_manager_init(struct hda_codec *cdc, void hda_component_manager_free(struct hda_codec *cdc, const struct component_master_ops *ops); -static inline int hda_component_manager_bind(struct hda_codec *cdc, - struct hda_component *comps) -{ - return component_bind_all(hda_codec_dev(cdc), comps); -} +int hda_component_manager_bind(struct hda_codec *cdc, + struct hda_component *comps, int count); static inline void hda_component_manager_unbind(struct hda_codec *cdc, struct hda_component *comps) |