aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2015-04-10 06:12:29 -0400
committerMark Brown <broonie@kernel.org>2015-04-10 10:38:37 -0400
commitca2641891d8f0503f166502d168690c1e7d38e49 (patch)
tree033ca1ccd5970227ebe260b607cc76b8402e5613
parent299e7e97cc33d2d8894250ae2a3101bfb5670141 (diff)
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>
-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)
1285 const struct of_device_id *of_id; 1285 const struct of_device_id *of_id;
1286 const char *p, *sprop; 1286 const char *p, *sprop;
1287 const uint32_t *iprop; 1287 const uint32_t *iprop;
1288 struct resource res; 1288 struct resource *res;
1289 void __iomem *iomem; 1289 void __iomem *iomem;
1290 char name[64]; 1290 char name[64];
1291 1291
@@ -1332,19 +1332,11 @@ static int fsl_ssi_probe(struct platform_device *pdev)
1332 } 1332 }
1333 ssi_private->cpu_dai_drv.name = dev_name(&pdev->dev); 1333 ssi_private->cpu_dai_drv.name = dev_name(&pdev->dev);
1334 1334
1335 /* Get the addresses and IRQ */ 1335 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1336 ret = of_address_to_resource(np, 0, &res); 1336 iomem = devm_ioremap_resource(&pdev->dev, res);
1337 if (ret) { 1337 if (IS_ERR(iomem))
1338 dev_err(&pdev->dev, "could not determine device resources\n"); 1338 return PTR_ERR(iomem);
1339 return ret; 1339 ssi_private->ssi_phys = res->start;
1340 }
1341 ssi_private->ssi_phys = res.start;
1342
1343 iomem = devm_ioremap(&pdev->dev, res.start, resource_size(&res));
1344 if (!iomem) {
1345 dev_err(&pdev->dev, "could not map device resources\n");
1346 return -ENOMEM;
1347 }
1348 1340
1349 ret = of_property_match_string(np, "clock-names", "ipg"); 1341 ret = of_property_match_string(np, "clock-names", "ipg");
1350 if (ret < 0) { 1342 if (ret < 0) {