Commit fc09cfbe authored by Tushar Behera's avatar Tushar Behera Committed by Mark Brown

ASoC: spear: Convert to use devm_ioremap_resource

Commit 75096579 ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

devm_request_mem_region is called in devm_ioremap_resource(). Hence that
part can also be removed.

Since devm_ioremap_resource prints error message on failure, there is
no need to print an explicit warning message.
Signed-off-by: default avatarTushar Behera <tushar.behera@linaro.org>
CC: alsa-devel@alsa-project.org
CC: Liam Girdwood <lgirdwood@gmail.com>
CC: Mark Brown <broonie@kernel.org>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 1d26f752
...@@ -282,27 +282,16 @@ static int spdif_out_probe(struct platform_device *pdev) ...@@ -282,27 +282,16 @@ static int spdif_out_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
int ret; int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -EINVAL;
if (!devm_request_mem_region(&pdev->dev, res->start,
resource_size(res), pdev->name)) {
dev_warn(&pdev->dev, "Failed to get memory resourse\n");
return -ENOENT;
}
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
if (!host) { if (!host) {
dev_warn(&pdev->dev, "kzalloc fail\n"); dev_warn(&pdev->dev, "kzalloc fail\n");
return -ENOMEM; return -ENOMEM;
} }
host->io_base = devm_request_and_ioremap(&pdev->dev, res); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!host->io_base) { host->io_base = devm_ioremap_resource(&pdev->dev, res);
dev_warn(&pdev->dev, "ioremap failed\n"); if (IS_ERR(host->io_base))
return -ENOMEM; return PTR_ERR(host->io_base);
}
host->clk = devm_clk_get(&pdev->dev, NULL); host->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(host->clk)) if (IS_ERR(host->clk))
......
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