summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_dma.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2010-08-03 17:55:28 -0500
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-08-12 14:00:17 +0100
commit87a0632b29410bab5c1783d7eb979c8d942d4209 (patch)
tree16762ec323b99ead5ab618b05ce99da234950800 /sound/soc/fsl/fsl_dma.c
parent1a3c5a491af6756dbba6ee166a9dee72bb414ba8 (diff)
asoc/multi-component: fsl: fix exit and error paths in DMA and SSI drivers
The error handling code in the OF probe function of the SSI driver is not freeing all resources correctly. Since the machine driver no longer calls the DMA driver to provide information about the SSI, we don't need to keep a list of DMA objects any more. In addition, the fsl_soc_dma_remove() function is incorrectly removing *all* DMA objects when it should only remove one. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/fsl/fsl_dma.c')
-rw-r--r--sound/soc/fsl/fsl_dma.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index 4450f9d845c6..57774cb91ae3 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -57,7 +57,6 @@
SNDRV_PCM_RATE_CONTINUOUS)
struct dma_object {
- struct list_head list;
struct snd_soc_platform_driver dai;
dma_addr_t ssi_stx_phys;
dma_addr_t ssi_srx_phys;
@@ -825,9 +824,6 @@ static void fsl_dma_free_dma_buffers(struct snd_pcm *pcm)
}
}
-/* List of DMA nodes that we've probed */
-static LIST_HEAD(dma_list);
-
/**
* find_ssi_node -- returns the SSI node that points to his DMA channel node
*
@@ -915,25 +911,20 @@ static int __devinit fsl_soc_dma_probe(struct of_device *of_dev,
dma->channel = of_iomap(np, 0);
dma->irq = irq_of_parse_and_map(np, 0);
- list_add(&dma->list, &dma_list);
+
+ dev_set_drvdata(&of_dev->dev, dma);
return 0;
}
static int __devexit fsl_soc_dma_remove(struct of_device *of_dev)
{
- struct list_head *n, *ptr;
- struct dma_object *dma;
+ struct dma_object *dma = dev_get_drvdata(&of_dev->dev);
- list_for_each_safe(ptr, n, &dma_list) {
- dma = list_entry(ptr, struct dma_object, list);
- list_del_init(ptr);
-
- snd_soc_unregister_platform(&of_dev->dev);
- iounmap(dma->channel);
- irq_dispose_mapping(dma->irq);
- kfree(dma);
- }
+ snd_soc_unregister_platform(&of_dev->dev);
+ iounmap(dma->channel);
+ irq_dispose_mapping(dma->irq);
+ kfree(dma);
return 0;
}