summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2015-04-10 13:12:29 +0300
committerMark Brown <broonie@kernel.org>2015-04-10 17:38:37 +0300
commitca2641891d8f0503f166502d168690c1e7d38e49 (patch)
tree033ca1ccd5970227ebe260b607cc76b8402e5613 /sound/soc
parent299e7e97cc33d2d8894250ae2a3101bfb5670141 (diff)
downloadlinux-ca2641891d8f0503f166502d168690c1e7d38e49.tar.xz
ASoC: fsl_ssi: Use devm_ioremap_resource()
Using platform_get_resource() and devm_ioremap_resource() can make the code a bit simpler. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/fsl/fsl_ssi.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 4201bfe2e9b9..4f643c45068f 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1285,7 +1285,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
const struct of_device_id *of_id;
const char *p, *sprop;
const uint32_t *iprop;
- struct resource res;
+ struct resource *res;
void __iomem *iomem;
char name[64];
@@ -1332,19 +1332,11 @@ static int fsl_ssi_probe(struct platform_device *pdev)
}
ssi_private->cpu_dai_drv.name = dev_name(&pdev->dev);
- /* Get the addresses and IRQ */
- ret = of_address_to_resource(np, 0, &res);
- if (ret) {
- dev_err(&pdev->dev, "could not determine device resources\n");
- return ret;
- }
- ssi_private->ssi_phys = res.start;
-
- iomem = devm_ioremap(&pdev->dev, res.start, resource_size(&res));
- if (!iomem) {
- dev_err(&pdev->dev, "could not map device resources\n");
- return -ENOMEM;
- }
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ iomem = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(iomem))
+ return PTR_ERR(iomem);
+ ssi_private->ssi_phys = res->start;
ret = of_property_match_string(np, "clock-names", "ipg");
if (ret < 0) {