diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2021-06-17 11:39:03 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-06-17 13:47:03 +0100 |
commit | 06e6d9044022e1be17757b2db5826115bc634868 (patch) | |
tree | d497f6d5c1f7cc960da07de963db00915805f906 /sound | |
parent | e99d7c69fd4c18e7319f8aab8e252b12130796bf (diff) | |
download | linux-06e6d9044022e1be17757b2db5826115bc634868.tar.gz linux-06e6d9044022e1be17757b2db5826115bc634868.tar.bz2 linux-06e6d9044022e1be17757b2db5826115bc634868.zip |
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/sti/sti_uniperif.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sound/soc/sti/sti_uniperif.c b/sound/soc/sti/sti_uniperif.c index e3561f00ed40..34668fe3909d 100644 --- a/sound/soc/sti/sti_uniperif.c +++ b/sound/soc/sti/sti_uniperif.c @@ -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); |