diff options
author | Simon Trimmer <simont@opensource.cirrus.com> | 2024-06-17 16:41:04 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2024-06-18 11:58:45 +0200 |
commit | 3b2a8582876d0b1ff1d8df9ff3cca03a70268fe2 (patch) | |
tree | 2110813b6806e0b0fb8a358033e630b721282604 /sound/pci/hda/cs35l41_hda.c | |
parent | 1adf91011f60e6d992cb1294e77a872845a390ed (diff) |
ALSA: hda: hda_component: Move codec field into the parent
There is one codec shared across all of the bound HDA components and a
copy is usually stashed in the amp driver so it doesn't need to be in
every hda_component.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/20240617154105.108635-4-simont@opensource.cirrus.com
Diffstat (limited to 'sound/pci/hda/cs35l41_hda.c')
-rw-r--r-- | sound/pci/hda/cs35l41_hda.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index ceba4f2c85f1..ee9f83b737de 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -1436,10 +1436,11 @@ static int cs35l41_hda_bind(struct device *dev, struct device *master, void *mas mutex_lock(&cs35l41->fw_mutex); comp->dev = dev; + cs35l41->codec = parent->codec; if (!cs35l41->acpi_subsystem_id) cs35l41->acpi_subsystem_id = kasprintf(GFP_KERNEL, "%.8x", - comp->codec->core.subsystem_id); - cs35l41->codec = comp->codec; + cs35l41->codec->core.subsystem_id); + strscpy(comp->name, dev_name(dev), sizeof(comp->name)); cs35l41->firmware_type = HDA_CS_DSP_FW_SPK_PROT; @@ -1470,7 +1471,7 @@ static int cs35l41_hda_bind(struct device *dev, struct device *master, void *mas mutex_unlock(&cs35l41->fw_mutex); sleep_flags = lock_system_sleep(); - if (!device_link_add(&comp->codec->core.dev, cs35l41->dev, DL_FLAG_STATELESS)) + if (!device_link_add(&cs35l41->codec->core.dev, cs35l41->dev, DL_FLAG_STATELESS)) dev_warn(dev, "Unable to create device link\n"); unlock_system_sleep(sleep_flags); |