Commit 72d09322 authored by YueHaibing's avatar YueHaibing Committed by Mark Brown

ASoC: mmp-sspa: 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-19-yuehaibing@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 94db6376
...@@ -399,7 +399,6 @@ static const struct snd_soc_component_driver mmp_sspa_component = { ...@@ -399,7 +399,6 @@ static const struct snd_soc_component_driver mmp_sspa_component = {
static int asoc_mmp_sspa_probe(struct platform_device *pdev) static int asoc_mmp_sspa_probe(struct platform_device *pdev)
{ {
struct sspa_priv *priv; struct sspa_priv *priv;
struct resource *res;
priv = devm_kzalloc(&pdev->dev, priv = devm_kzalloc(&pdev->dev,
sizeof(struct sspa_priv), GFP_KERNEL); sizeof(struct sspa_priv), GFP_KERNEL);
...@@ -417,8 +416,7 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev) ...@@ -417,8 +416,7 @@ static int asoc_mmp_sspa_probe(struct platform_device *pdev)
if (priv->dma_params == NULL) if (priv->dma_params == NULL)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->sspa->mmio_base = devm_platform_ioremap_resource(pdev, 0);
priv->sspa->mmio_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->sspa->mmio_base)) if (IS_ERR(priv->sspa->mmio_base))
return PTR_ERR(priv->sspa->mmio_base); return PTR_ERR(priv->sspa->mmio_base);
......
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