mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
mmc: cavium: Add missed pci_release_regions
The driver forgets to call pci_release_regions() in probe failure and remove. Add the missed calls to fix it. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Link: https://lore.kernel.org/r/20191206075408.18355-1-hslester96@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
committed by
Ulf Hansson
parent
4edf6f7008
commit
f630d0114d
@@ -76,8 +76,10 @@ static int thunder_mmc_probe(struct pci_dev *pdev,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
host->base = pcim_iomap(pdev, 0, pci_resource_len(pdev, 0));
|
host->base = pcim_iomap(pdev, 0, pci_resource_len(pdev, 0));
|
||||||
if (!host->base)
|
if (!host->base) {
|
||||||
return -EINVAL;
|
ret = -EINVAL;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
/* On ThunderX these are identical */
|
/* On ThunderX these are identical */
|
||||||
host->dma_base = host->base;
|
host->dma_base = host->base;
|
||||||
@@ -86,12 +88,14 @@ static int thunder_mmc_probe(struct pci_dev *pdev,
|
|||||||
host->reg_off_dma = 0x160;
|
host->reg_off_dma = 0x160;
|
||||||
|
|
||||||
host->clk = devm_clk_get(dev, NULL);
|
host->clk = devm_clk_get(dev, NULL);
|
||||||
if (IS_ERR(host->clk))
|
if (IS_ERR(host->clk)) {
|
||||||
return PTR_ERR(host->clk);
|
ret = PTR_ERR(host->clk);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
ret = clk_prepare_enable(host->clk);
|
ret = clk_prepare_enable(host->clk);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto error;
|
||||||
host->sys_freq = clk_get_rate(host->clk);
|
host->sys_freq = clk_get_rate(host->clk);
|
||||||
|
|
||||||
spin_lock_init(&host->irq_handler_lock);
|
spin_lock_init(&host->irq_handler_lock);
|
||||||
@@ -157,6 +161,7 @@ error:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
clk_disable_unprepare(host->clk);
|
clk_disable_unprepare(host->clk);
|
||||||
|
pci_release_regions(pdev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,6 +180,7 @@ static void thunder_mmc_remove(struct pci_dev *pdev)
|
|||||||
writeq(dma_cfg, host->dma_base + MIO_EMM_DMA_CFG(host));
|
writeq(dma_cfg, host->dma_base + MIO_EMM_DMA_CFG(host));
|
||||||
|
|
||||||
clk_disable_unprepare(host->clk);
|
clk_disable_unprepare(host->clk);
|
||||||
|
pci_release_regions(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct pci_device_id thunder_mmc_id_table[] = {
|
static const struct pci_device_id thunder_mmc_id_table[] = {
|
||||||
|
Reference in New Issue
Block a user