mirror of https://gitee.com/openkylin/linux.git
mmc: cavium-octeon: Use devm_platform_ioremap_resource()
Simplify this function implementation by using a known wrapper function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
d67da5c905
commit
824b90bbaf
|
@ -148,7 +148,6 @@ static int octeon_mmc_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device_node *cn, *node = pdev->dev.of_node;
|
struct device_node *cn, *node = pdev->dev.of_node;
|
||||||
struct cvm_mmc_host *host;
|
struct cvm_mmc_host *host;
|
||||||
struct resource *res;
|
|
||||||
void __iomem *base;
|
void __iomem *base;
|
||||||
int mmc_irq[9];
|
int mmc_irq[9];
|
||||||
int i, ret = 0;
|
int i, ret = 0;
|
||||||
|
@ -205,23 +204,13 @@ static int octeon_mmc_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
host->last_slot = -1;
|
host->last_slot = -1;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (!res) {
|
|
||||||
dev_err(&pdev->dev, "Platform resource[0] is missing\n");
|
|
||||||
return -ENXIO;
|
|
||||||
}
|
|
||||||
base = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(base))
|
if (IS_ERR(base))
|
||||||
return PTR_ERR(base);
|
return PTR_ERR(base);
|
||||||
host->base = (void __iomem *)base;
|
host->base = (void __iomem *)base;
|
||||||
host->reg_off = 0;
|
host->reg_off = 0;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
base = devm_platform_ioremap_resource(pdev, 1);
|
||||||
if (!res) {
|
|
||||||
dev_err(&pdev->dev, "Platform resource[1] is missing\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
base = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(base))
|
if (IS_ERR(base))
|
||||||
return PTR_ERR(base);
|
return PTR_ERR(base);
|
||||||
host->dma_base = (void __iomem *)base;
|
host->dma_base = (void __iomem *)base;
|
||||||
|
|
Loading…
Reference in New Issue