diff mbox series

[v2,3/3] ALSA: hda/realtek: Delete cs35l41 component master during free

Message ID 20230605152855.448115-4-sbinding@opensource.cirrus.com
State Superseded
Headers show
Series Fixes and cleanup for CS35L41 HDA | expand

Commit Message

Stefan Binding June 5, 2023, 3:28 p.m. UTC
This ensures that the driver is properly cleaned up when freed.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
 sound/pci/hda/patch_realtek.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Takashi Iwai June 5, 2023, 4 p.m. UTC | #1
On Mon, 05 Jun 2023 17:28:55 +0200,
Stefan Binding wrote:
> 
> This ensures that the driver is properly cleaned up when freed.
> 
> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
> ---
>  sound/pci/hda/patch_realtek.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index 7b5f194513c7b..e3774903918fe 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -6757,6 +6757,8 @@ static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char
>  		else
>  			spec->gen.pcm_playback_hook = comp_generic_playback_hook;
>  		break;
> +	case HDA_FIXUP_ACT_FREE:
> +		component_master_del(dev, &comp_master_ops);
>  	}

Don't forget to add break here.


thanks,

Takashi
diff mbox series

Patch

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 7b5f194513c7b..e3774903918fe 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6757,6 +6757,8 @@  static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char
 		else
 			spec->gen.pcm_playback_hook = comp_generic_playback_hook;
 		break;
+	case HDA_FIXUP_ACT_FREE:
+		component_master_del(dev, &comp_master_ops);
 	}
 }