Commit ebdd7be5 authored by YueHaibing's avatar YueHaibing Committed by Mark Brown

ASoC: xtfpga-i2s: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190727150738.54764-15-yuehaibing@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 89dd38bf
...@@ -531,7 +531,6 @@ static int xtfpga_i2s_runtime_resume(struct device *dev) ...@@ -531,7 +531,6 @@ static int xtfpga_i2s_runtime_resume(struct device *dev)
static int xtfpga_i2s_probe(struct platform_device *pdev) static int xtfpga_i2s_probe(struct platform_device *pdev)
{ {
struct xtfpga_i2s *i2s; struct xtfpga_i2s *i2s;
struct resource *mem;
int err, irq; int err, irq;
i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL); i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL);
...@@ -543,8 +542,7 @@ static int xtfpga_i2s_probe(struct platform_device *pdev) ...@@ -543,8 +542,7 @@ static int xtfpga_i2s_probe(struct platform_device *pdev)
i2s->dev = &pdev->dev; i2s->dev = &pdev->dev;
dev_dbg(&pdev->dev, "dev: %p, i2s: %p\n", &pdev->dev, i2s); dev_dbg(&pdev->dev, "dev: %p, i2s: %p\n", &pdev->dev, i2s);
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); i2s->regs = devm_platform_ioremap_resource(pdev, 0);
i2s->regs = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(i2s->regs)) { if (IS_ERR(i2s->regs)) {
err = PTR_ERR(i2s->regs); err = PTR_ERR(i2s->regs);
goto err; goto err;
......
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