Skip to content

Commit

Permalink
ASoC: qcom: apq8016_sbc: 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 21, 2021
1 parent 683b0df commit e6bb518
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions sound/soc/qcom/apq8016_sbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ static int apq8016_sbc_platform_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct snd_soc_card *card;
struct apq8016_sbc_data *data;
struct resource *res;
int ret;

data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
Expand All @@ -151,13 +150,11 @@ static int apq8016_sbc_platform_probe(struct platform_device *pdev)
if (ret)
return ret;

res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mic-iomux");
data->mic_iomux = devm_ioremap_resource(dev, res);
data->mic_iomux = devm_platform_ioremap_resource_byname(pdev, "mic-iomux");
if (IS_ERR(data->mic_iomux))
return PTR_ERR(data->mic_iomux);

res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "spkr-iomux");
data->spkr_iomux = devm_ioremap_resource(dev, res);
data->spkr_iomux = devm_platform_ioremap_resource_byname(pdev, "spkr-iomux");
if (IS_ERR(data->spkr_iomux))
return PTR_ERR(data->spkr_iomux);

Expand Down

0 comments on commit e6bb518

Please sign in to comment.