diff options
Diffstat (limited to 'arch/arm/plat-omap/dma.c')
-rw-r--r-- | arch/arm/plat-omap/dma.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 01619c2910e3..5f5b975887fc 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -2000,6 +2000,12 @@ void omap_dma_global_context_restore(void) | |||
2000 | omap_clear_dma(ch); | 2000 | omap_clear_dma(ch); |
2001 | } | 2001 | } |
2002 | 2002 | ||
2003 | struct omap_system_dma_plat_info *omap_get_plat_info(void) | ||
2004 | { | ||
2005 | return p; | ||
2006 | } | ||
2007 | EXPORT_SYMBOL_GPL(omap_get_plat_info); | ||
2008 | |||
2003 | static int omap_system_dma_probe(struct platform_device *pdev) | 2009 | static int omap_system_dma_probe(struct platform_device *pdev) |
2004 | { | 2010 | { |
2005 | int ch, ret = 0; | 2011 | int ch, ret = 0; |
@@ -2024,9 +2030,16 @@ static int omap_system_dma_probe(struct platform_device *pdev) | |||
2024 | 2030 | ||
2025 | dma_lch_count = d->lch_count; | 2031 | dma_lch_count = d->lch_count; |
2026 | dma_chan_count = dma_lch_count; | 2032 | dma_chan_count = dma_lch_count; |
2027 | dma_chan = d->chan; | ||
2028 | enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; | 2033 | enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; |
2029 | 2034 | ||
2035 | dma_chan = devm_kcalloc(&pdev->dev, dma_lch_count, | ||
2036 | sizeof(struct omap_dma_lch), GFP_KERNEL); | ||
2037 | if (!dma_chan) { | ||
2038 | dev_err(&pdev->dev, "%s: kzalloc fail\n", __func__); | ||
2039 | return -ENOMEM; | ||
2040 | } | ||
2041 | |||
2042 | |||
2030 | if (dma_omap2plus()) { | 2043 | if (dma_omap2plus()) { |
2031 | dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * | 2044 | dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * |
2032 | dma_lch_count, GFP_KERNEL); | 2045 | dma_lch_count, GFP_KERNEL); |
@@ -2111,7 +2124,6 @@ exit_dma_irq_fail: | |||
2111 | } | 2124 | } |
2112 | 2125 | ||
2113 | exit_dma_lch_fail: | 2126 | exit_dma_lch_fail: |
2114 | kfree(dma_chan); | ||
2115 | return ret; | 2127 | return ret; |
2116 | } | 2128 | } |
2117 | 2129 | ||
@@ -2131,7 +2143,6 @@ static int omap_system_dma_remove(struct platform_device *pdev) | |||
2131 | free_irq(dma_irq, (void *)(irq_rel + 1)); | 2143 | free_irq(dma_irq, (void *)(irq_rel + 1)); |
2132 | } | 2144 | } |
2133 | } | 2145 | } |
2134 | kfree(dma_chan); | ||
2135 | return 0; | 2146 | return 0; |
2136 | } | 2147 | } |
2137 | 2148 | ||