diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-02-27 18:17:28 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-03-03 11:28:12 +0100 |
commit | 9a6246ff78ac33af78f82704cde6fec361597eea (patch) | |
tree | abb77fd575a77c4fe97ac1d5b3d76682d465935a /sound/pci/hda/hda_bind.c | |
parent | ALSA: core: Re-add snd_device_disconnect() (diff) | |
download | linux-9a6246ff78ac33af78f82704cde6fec361597eea.tar.xz linux-9a6246ff78ac33af78f82704cde6fec361597eea.zip |
ALSA: hda - Implement unbind more safely
Now we have all pieces ready, and put them into places:
- add the hda_pcm refcount to azx_pcm_open() and azx_pcm_close(),
- call the most of cleanup code in hda_codec_reset() from the codec
driver remove,
- call the same code also from the hda_codec object free.
Then the codec driver can be unbound more safely now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_bind.c')
-rw-r--r-- | sound/pci/hda/hda_bind.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_bind.c b/sound/pci/hda/hda_bind.c index 2d00417494e2..311896a23cd1 100644 --- a/sound/pci/hda/hda_bind.c +++ b/sound/pci/hda/hda_bind.c @@ -125,8 +125,7 @@ static int hda_codec_driver_remove(struct device *dev) if (codec->patch_ops.free) codec->patch_ops.free(codec); - codec->preset = NULL; - memset(&codec->patch_ops, 0, sizeof(codec->patch_ops)); + snd_hda_codec_cleanup_for_unbind(codec); module_put(dev->driver->owner); return 0; } |