Commit d6e9e068 authored by Christian Lütke-Stetzkamp's avatar Christian Lütke-Stetzkamp Committed by Greg Kroah-Hartman

staging: mt7621-mmc: Fix unmatched release_mem_regin

Current code calls release_mem_regin on driver remove without
requesting it explicit first. The region is only requested via
devm_ioremap_resource and that releases it automatically. Removing the
release_mem_region calls fixes this.
Signed-off-by: default avatarChristian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fb922724
...@@ -2694,10 +2694,9 @@ static void msdc_init_gpd_bd(struct msdc_host *host, struct msdc_dma *dma) ...@@ -2694,10 +2694,9 @@ static void msdc_init_gpd_bd(struct msdc_host *host, struct msdc_dma *dma)
static int msdc_drv_probe(struct platform_device *pdev) static int msdc_drv_probe(struct platform_device *pdev)
{ {
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct resource *res;
__iomem void *base; __iomem void *base;
struct mmc_host *mmc; struct mmc_host *mmc;
struct resource *mem;
struct msdc_host *host; struct msdc_host *host;
struct msdc_hw *hw; struct msdc_hw *hw;
int ret, irq; int ret, irq;
...@@ -2713,11 +2712,11 @@ static int msdc_drv_probe(struct platform_device *pdev) ...@@ -2713,11 +2712,11 @@ static int msdc_drv_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
hw = (struct msdc_hw *)pdev->dev.platform_data; hw = (struct msdc_hw *)pdev->dev.platform_data;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
//BUG_ON((!hw) || (!mem) || (irq < 0)); /* --- by chhung */ //BUG_ON((!hw) || (!mem) || (irq < 0)); /* --- by chhung */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, res); base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) { if (IS_ERR(base)) {
ret = PTR_ERR(base); ret = PTR_ERR(base);
...@@ -2856,9 +2855,6 @@ static int msdc_drv_probe(struct platform_device *pdev) ...@@ -2856,9 +2855,6 @@ static int msdc_drv_probe(struct platform_device *pdev)
cancel_delayed_work_sync(&host->card_delaywork); cancel_delayed_work_sync(&host->card_delaywork);
#endif #endif
if (mem)
release_mem_region(mem->start, mem->end - mem->start + 1);
host_free: host_free:
mmc_free_host(mmc); mmc_free_host(mmc);
...@@ -2870,7 +2866,6 @@ static int msdc_drv_remove(struct platform_device *pdev) ...@@ -2870,7 +2866,6 @@ static int msdc_drv_remove(struct platform_device *pdev)
{ {
struct mmc_host *mmc; struct mmc_host *mmc;
struct msdc_host *host; struct msdc_host *host;
struct resource *mem;
mmc = platform_get_drvdata(pdev); mmc = platform_get_drvdata(pdev);
BUG_ON(!mmc); BUG_ON(!mmc);
...@@ -2894,11 +2889,6 @@ static int msdc_drv_remove(struct platform_device *pdev) ...@@ -2894,11 +2889,6 @@ static int msdc_drv_remove(struct platform_device *pdev)
dma_free_coherent(NULL, MAX_GPD_NUM * sizeof(struct gpd), host->dma.gpd, host->dma.gpd_addr); dma_free_coherent(NULL, MAX_GPD_NUM * sizeof(struct gpd), host->dma.gpd, host->dma.gpd_addr);
dma_free_coherent(NULL, MAX_BD_NUM * sizeof(struct bd), host->dma.bd, host->dma.bd_addr); dma_free_coherent(NULL, MAX_BD_NUM * sizeof(struct bd), host->dma.bd, host->dma.bd_addr);
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (mem)
release_mem_region(mem->start, mem->end - mem->start + 1);
mmc_free_host(host->mmc); mmc_free_host(host->mmc);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment