diff options
author | Sebastien Guiriec <s-guiriec@ti.com> | 2013-02-13 02:21:54 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-03-03 22:17:28 -0500 |
commit | ddd17531ad9089ca1a758cd53fb698f396665cb5 (patch) | |
tree | dacfb226cf312847e2cab94b601bf92644aa5d63 /sound/soc/omap | |
parent | 6dbe51c251a327e012439c4772097a13df43c5b8 (diff) |
ASoC: omap-mcpdm: Clean up with devm_* function
Clean up McPDM driver with devm_ function.
Signed-off-by: Sebastien Guiriec <s-guiriec@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/omap')
-rw-r--r-- | sound/soc/omap/omap-mcpdm.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index 5ca11bdac21e..079f277cdba4 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c | |||
@@ -369,7 +369,7 @@ static int omap_mcpdm_probe(struct snd_soc_dai *dai) | |||
369 | pm_runtime_get_sync(mcpdm->dev); | 369 | pm_runtime_get_sync(mcpdm->dev); |
370 | omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, 0x00); | 370 | omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, 0x00); |
371 | 371 | ||
372 | ret = request_irq(mcpdm->irq, omap_mcpdm_irq_handler, | 372 | ret = devm_request_irq(mcpdm->dev, mcpdm->irq, omap_mcpdm_irq_handler, |
373 | 0, "McPDM", (void *)mcpdm); | 373 | 0, "McPDM", (void *)mcpdm); |
374 | 374 | ||
375 | pm_runtime_put_sync(mcpdm->dev); | 375 | pm_runtime_put_sync(mcpdm->dev); |
@@ -389,7 +389,6 @@ static int omap_mcpdm_remove(struct snd_soc_dai *dai) | |||
389 | { | 389 | { |
390 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); | 390 | struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); |
391 | 391 | ||
392 | free_irq(mcpdm->irq, (void *)mcpdm); | ||
393 | pm_runtime_disable(mcpdm->dev); | 392 | pm_runtime_disable(mcpdm->dev); |
394 | 393 | ||
395 | return 0; | 394 | return 0; |
@@ -465,14 +464,11 @@ static int asoc_mcpdm_probe(struct platform_device *pdev) | |||
465 | if (res == NULL) | 464 | if (res == NULL) |
466 | return -ENOMEM; | 465 | return -ENOMEM; |
467 | 466 | ||
468 | if (!devm_request_mem_region(&pdev->dev, res->start, | 467 | mcpdm->io_base = devm_request_and_ioremap(&pdev->dev, res); |
469 | resource_size(res), "McPDM")) | 468 | if (!mcpdm->io_base) { |
470 | return -EBUSY; | 469 | dev_err(&pdev->dev, "cannot remap\n"); |
471 | |||
472 | mcpdm->io_base = devm_ioremap(&pdev->dev, res->start, | ||
473 | resource_size(res)); | ||
474 | if (!mcpdm->io_base) | ||
475 | return -ENOMEM; | 470 | return -ENOMEM; |
471 | } | ||
476 | 472 | ||
477 | mcpdm->irq = platform_get_irq(pdev, 0); | 473 | mcpdm->irq = platform_get_irq(pdev, 0); |
478 | if (mcpdm->irq < 0) | 474 | if (mcpdm->irq < 0) |