summaryrefslogtreecommitdiffstats
path: root/sound/hda
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2015-08-21 15:47:40 +0530
committerTakashi Iwai <tiwai@suse.de>2015-08-21 12:34:00 +0200
commitee2d51b3d4c940cd34dbc83eb10bb24205c56ebf (patch)
tree2d3ac3c8b6f05ccaa496b9edb164e93baf76adf5 /sound/hda
parent9430e547894d2ff099e5717050eb40c1e1dd2bad (diff)
downloadlinux-ee2d51b3d4c940cd34dbc83eb10bb24205c56ebf.tar.bz2
ALSA: hdac: Add API for removing hdac extended device
The HDAC extended device objects are created by HDAC extended bus on probe. When controller is removed they should be removed as well, so add API snd_hdac_ext_bus_device_remove for this Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/hda')
-rw-r--r--sound/hda/ext/hdac_ext_bus.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/hda/ext/hdac_ext_bus.c b/sound/hda/ext/hdac_ext_bus.c
index 0aa5d9eb6c3f..cf69202f7da0 100644
--- a/sound/hda/ext/hdac_ext_bus.c
+++ b/sound/hda/ext/hdac_ext_bus.c
@@ -172,3 +172,22 @@ void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev)
kfree(hdev);
}
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_exit);
+
+/**
+ * snd_hdac_ext_bus_device_remove - remove HD-audio extended codec base devices
+ *
+ * @ebus: HD-audio extended bus
+ */
+void snd_hdac_ext_bus_device_remove(struct hdac_ext_bus *ebus)
+{
+ struct hdac_device *codec, *__codec;
+ /*
+ * we need to remove all the codec devices objects created in the
+ * snd_hdac_ext_bus_device_init
+ */
+ list_for_each_entry_safe(codec, __codec, &ebus->bus.codec_list, list) {
+ snd_hdac_device_unregister(codec);
+ put_device(&codec->dev);
+ }
+}
+EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_remove);