diff options
author | Vinod Koul <vinod.koul@intel.com> | 2016-01-06 04:48:44 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2016-01-06 04:48:44 -0500 |
commit | 62ddae372f6eba4815f53aad1ade32d3e4950a7c (patch) | |
tree | 16f87d08e161892b7983893ce46c80b428d3cef9 /drivers/dma | |
parent | a6eaf23b050b642ec5e673be56a72bd9efb4fd69 (diff) | |
parent | aeb8974ac70f07659b7e5b6fca5bf4d5b4495d4d (diff) |
Merge branch 'topic/ste' into for-linus
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/ste_dma40.c | 87 |
1 files changed, 42 insertions, 45 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index dd3e7ba273ad..6fb8307468ab 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -3543,8 +3543,8 @@ static int __init d40_probe(struct platform_device *pdev) | |||
3543 | struct stedma40_platform_data *plat_data = dev_get_platdata(&pdev->dev); | 3543 | struct stedma40_platform_data *plat_data = dev_get_platdata(&pdev->dev); |
3544 | struct device_node *np = pdev->dev.of_node; | 3544 | struct device_node *np = pdev->dev.of_node; |
3545 | int ret = -ENOENT; | 3545 | int ret = -ENOENT; |
3546 | struct d40_base *base = NULL; | 3546 | struct d40_base *base; |
3547 | struct resource *res = NULL; | 3547 | struct resource *res; |
3548 | int num_reserved_chans; | 3548 | int num_reserved_chans; |
3549 | u32 val; | 3549 | u32 val; |
3550 | 3550 | ||
@@ -3552,17 +3552,17 @@ static int __init d40_probe(struct platform_device *pdev) | |||
3552 | if (np) { | 3552 | if (np) { |
3553 | if (d40_of_probe(pdev, np)) { | 3553 | if (d40_of_probe(pdev, np)) { |
3554 | ret = -ENOMEM; | 3554 | ret = -ENOMEM; |
3555 | goto failure; | 3555 | goto report_failure; |
3556 | } | 3556 | } |
3557 | } else { | 3557 | } else { |
3558 | d40_err(&pdev->dev, "No pdata or Device Tree provided\n"); | 3558 | d40_err(&pdev->dev, "No pdata or Device Tree provided\n"); |
3559 | goto failure; | 3559 | goto report_failure; |
3560 | } | 3560 | } |
3561 | } | 3561 | } |
3562 | 3562 | ||
3563 | base = d40_hw_detect_init(pdev); | 3563 | base = d40_hw_detect_init(pdev); |
3564 | if (!base) | 3564 | if (!base) |
3565 | goto failure; | 3565 | goto report_failure; |
3566 | 3566 | ||
3567 | num_reserved_chans = d40_phy_res_init(base); | 3567 | num_reserved_chans = d40_phy_res_init(base); |
3568 | 3568 | ||
@@ -3693,51 +3693,48 @@ static int __init d40_probe(struct platform_device *pdev) | |||
3693 | return 0; | 3693 | return 0; |
3694 | 3694 | ||
3695 | failure: | 3695 | failure: |
3696 | if (base) { | 3696 | kmem_cache_destroy(base->desc_slab); |
3697 | if (base->desc_slab) | 3697 | if (base->virtbase) |
3698 | kmem_cache_destroy(base->desc_slab); | 3698 | iounmap(base->virtbase); |
3699 | if (base->virtbase) | ||
3700 | iounmap(base->virtbase); | ||
3701 | |||
3702 | if (base->lcla_pool.base && base->plat_data->use_esram_lcla) { | ||
3703 | iounmap(base->lcla_pool.base); | ||
3704 | base->lcla_pool.base = NULL; | ||
3705 | } | ||
3706 | 3699 | ||
3707 | if (base->lcla_pool.dma_addr) | 3700 | if (base->lcla_pool.base && base->plat_data->use_esram_lcla) { |
3708 | dma_unmap_single(base->dev, base->lcla_pool.dma_addr, | 3701 | iounmap(base->lcla_pool.base); |
3709 | SZ_1K * base->num_phy_chans, | 3702 | base->lcla_pool.base = NULL; |
3710 | DMA_TO_DEVICE); | 3703 | } |
3711 | |||
3712 | if (!base->lcla_pool.base_unaligned && base->lcla_pool.base) | ||
3713 | free_pages((unsigned long)base->lcla_pool.base, | ||
3714 | base->lcla_pool.pages); | ||
3715 | |||
3716 | kfree(base->lcla_pool.base_unaligned); | ||
3717 | |||
3718 | if (base->phy_lcpa) | ||
3719 | release_mem_region(base->phy_lcpa, | ||
3720 | base->lcpa_size); | ||
3721 | if (base->phy_start) | ||
3722 | release_mem_region(base->phy_start, | ||
3723 | base->phy_size); | ||
3724 | if (base->clk) { | ||
3725 | clk_disable_unprepare(base->clk); | ||
3726 | clk_put(base->clk); | ||
3727 | } | ||
3728 | 3704 | ||
3729 | if (base->lcpa_regulator) { | 3705 | if (base->lcla_pool.dma_addr) |
3730 | regulator_disable(base->lcpa_regulator); | 3706 | dma_unmap_single(base->dev, base->lcla_pool.dma_addr, |
3731 | regulator_put(base->lcpa_regulator); | 3707 | SZ_1K * base->num_phy_chans, |
3732 | } | 3708 | DMA_TO_DEVICE); |
3733 | 3709 | ||
3734 | kfree(base->lcla_pool.alloc_map); | 3710 | if (!base->lcla_pool.base_unaligned && base->lcla_pool.base) |
3735 | kfree(base->lookup_log_chans); | 3711 | free_pages((unsigned long)base->lcla_pool.base, |
3736 | kfree(base->lookup_phy_chans); | 3712 | base->lcla_pool.pages); |
3737 | kfree(base->phy_res); | 3713 | |
3738 | kfree(base); | 3714 | kfree(base->lcla_pool.base_unaligned); |
3715 | |||
3716 | if (base->phy_lcpa) | ||
3717 | release_mem_region(base->phy_lcpa, | ||
3718 | base->lcpa_size); | ||
3719 | if (base->phy_start) | ||
3720 | release_mem_region(base->phy_start, | ||
3721 | base->phy_size); | ||
3722 | if (base->clk) { | ||
3723 | clk_disable_unprepare(base->clk); | ||
3724 | clk_put(base->clk); | ||
3725 | } | ||
3726 | |||
3727 | if (base->lcpa_regulator) { | ||
3728 | regulator_disable(base->lcpa_regulator); | ||
3729 | regulator_put(base->lcpa_regulator); | ||
3739 | } | 3730 | } |
3740 | 3731 | ||
3732 | kfree(base->lcla_pool.alloc_map); | ||
3733 | kfree(base->lookup_log_chans); | ||
3734 | kfree(base->lookup_phy_chans); | ||
3735 | kfree(base->phy_res); | ||
3736 | kfree(base); | ||
3737 | report_failure: | ||
3741 | d40_err(&pdev->dev, "probe failed\n"); | 3738 | d40_err(&pdev->dev, "probe failed\n"); |
3742 | return ret; | 3739 | return ret; |
3743 | } | 3740 | } |