ASoC: Intel: Skylake: Unmap the address last

In Skylake destructor we unmap the hardware address and then free
links and streams. The stream free accesses hardware to write to
registers and predictably causes oops.

So change the order and unmap last in destructor.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Vinod Koul 2016-03-15 16:39:26 +05:30 committed by Mark Brown
parent 3f7f8489e2
commit 077411e5eb
1 changed files with 4 additions and 3 deletions

View File

@ -316,12 +316,13 @@ static int skl_free(struct hdac_ext_bus *ebus)
if (bus->irq >= 0) if (bus->irq >= 0)
free_irq(bus->irq, (void *)bus); free_irq(bus->irq, (void *)bus);
if (bus->remap_addr)
iounmap(bus->remap_addr);
snd_hdac_bus_free_stream_pages(bus); snd_hdac_bus_free_stream_pages(bus);
snd_hdac_stream_free_all(ebus); snd_hdac_stream_free_all(ebus);
snd_hdac_link_free_all(ebus); snd_hdac_link_free_all(ebus);
if (bus->remap_addr)
iounmap(bus->remap_addr);
pci_release_regions(skl->pci); pci_release_regions(skl->pci);
pci_disable_device(skl->pci); pci_disable_device(skl->pci);