Skip to content

Commit

Permalink
ASoC: sti: sti_uniperif: Use devm_platform_get_and_ioremap_resource()
Browse files Browse the repository at this point in the history
Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Yang Yingliang authored and broonie committed Jun 17, 2021
1 parent e99d7c6 commit 06e6d90
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions sound/soc/sti/sti_uniperif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 06e6d90

Please sign in to comment.