ASoC: sti: sti_uniperif: Use devm_platform_get_and_ioremap_resource()

Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210617033903.613727-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Yang Yingliang 2021-06-17 11:39:03 +08:00 committed by Mark Brown
parent e99d7c69fd
commit 06e6d90440
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 10 deletions

View File

@ -410,16 +410,8 @@ static int sti_uniperiph_cpu_dai_of(struct device_node *node,
*dai = sti_uniperiph_dai_template;
dai->name = dev_data->dai_names;
/* Get resources */
uni->mem_region = platform_get_resource(priv->pdev, IORESOURCE_MEM, 0);
if (!uni->mem_region) {
dev_err(dev, "Failed to get memory resource\n");
return -ENODEV;
}
uni->base = devm_ioremap_resource(dev, uni->mem_region);
/* Get resources and base address */
uni->base = devm_platform_get_and_ioremap_resource(priv->pdev, 0, &uni->mem_region);
if (IS_ERR(uni->base))
return PTR_ERR(uni->base);