diff mbox

[2/6] ASoC: Intel: Skylake: free codec objects on removal

Message ID 1458035836-1843-3-git-send-email-vinod.koul@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vinod Koul March 15, 2016, 9:57 a.m. UTC
On driver removal we should ask the core to remove the device
objects as well, so invoke snd_hdac_ext_bus_device_remove() in
remove.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/skylake/skl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Mark Brown March 15, 2016, 10:07 a.m. UTC | #1
On Tue, Mar 15, 2016 at 03:27:12PM +0530, Vinod Koul wrote:

> +/*
> + * codec destructor
> + */
> +static void skl_codecs_remove(struct hdac_ext_bus *ebus)
> +{
> +	snd_hdac_ext_bus_device_remove(ebus);
> +}

> +	skl_codecs_remove(ebus);

Why the wrapper here?
Vinod Koul March 15, 2016, 10:52 a.m. UTC | #2
On Tue, Mar 15, 2016 at 10:07:43AM +0000, Mark Brown wrote:
> On Tue, Mar 15, 2016 at 03:27:12PM +0530, Vinod Koul wrote:
> 
> > +/*
> > + * codec destructor
> > + */
> > +static void skl_codecs_remove(struct hdac_ext_bus *ebus)
> > +{
> > +	snd_hdac_ext_bus_device_remove(ebus);
> > +}
> 
> > +	skl_codecs_remove(ebus);
> 
> Why the wrapper here?

IIRC Shameless copy of old HDA code, but yes I don't think we need this,
I will update this one.

Thanks for pointing out.
diff mbox

Patch

diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index ab5e25aaeee3..371df495dd14 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -454,6 +454,14 @@  static int skl_codec_create(struct hdac_ext_bus *ebus)
 	return 0;
 }
 
+/*
+ * codec destructor
+ */
+static void skl_codecs_remove(struct hdac_ext_bus *ebus)
+{
+	snd_hdac_ext_bus_device_remove(ebus);
+}
+
 static const struct hdac_bus_ops bus_core_ops = {
 	.command = snd_hdac_bus_send_cmd,
 	.get_response = snd_hdac_bus_get_response,
@@ -725,6 +733,7 @@  static void skl_remove(struct pci_dev *pci)
 	if (pci_dev_run_wake(pci))
 		pm_runtime_get_noresume(&pci->dev);
 	pci_dev_put(pci);
+	skl_codecs_remove(ebus);
 	skl_platform_unregister(&pci->dev);
 	skl_free_dsp(skl);
 	skl_machine_device_unregister(skl);