Commit 57e5b8bf authored by Wang ShaoBo's avatar Wang ShaoBo Committed by Jonathan Cameron

iio: adc: stm32-dfsdm: Use devm_platform_get_and_ioremap_resource()

Make use of devm_platform_get_and_ioremap_resource() provided by
driver core platform instead of duplicated analogue, dev_err() is
removed because it has been done in devm_ioremap_resource().
Signed-off-by: default avatarWang ShaoBo <bobo.shaobowang@huawei.com>
Link: https://lore.kernel.org/r/20200918083142.32816-1-bobo.shaobowang@huawei.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent cbc4ca35
...@@ -226,16 +226,13 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev, ...@@ -226,16 +226,13 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev,
if (!node) if (!node)
return -EINVAL; return -EINVAL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->dfsdm.base = devm_platform_get_and_ioremap_resource(pdev, 0,
if (!res) { &res);
dev_err(&pdev->dev, "Failed to get memory resource\n");
return -ENODEV;
}
priv->dfsdm.phys_base = res->start;
priv->dfsdm.base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->dfsdm.base)) if (IS_ERR(priv->dfsdm.base))
return PTR_ERR(priv->dfsdm.base); return PTR_ERR(priv->dfsdm.base);
priv->dfsdm.phys_base = res->start;
/* /*
* "dfsdm" clock is mandatory for DFSDM peripheral clocking. * "dfsdm" clock is mandatory for DFSDM peripheral clocking.
* "dfsdm" or "audio" clocks can be used as source clock for * "dfsdm" or "audio" clocks can be used as source clock for
......
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