Skip to content

Commit

Permalink
ASoC: omap-mcpdm: Clean up with devm_* function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastien Guiriec authored and Mark Brown committed Mar 4, 2013
1 parent 6dbe51c commit ddd1753
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions sound/soc/omap/omap-mcpdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ static int omap_mcpdm_probe(struct snd_soc_dai *dai)
pm_runtime_get_sync(mcpdm->dev);
omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, 0x00);

ret = request_irq(mcpdm->irq, omap_mcpdm_irq_handler,
ret = devm_request_irq(mcpdm->dev, mcpdm->irq, omap_mcpdm_irq_handler,
0, "McPDM", (void *)mcpdm);

pm_runtime_put_sync(mcpdm->dev);
Expand All @@ -389,7 +389,6 @@ static int omap_mcpdm_remove(struct snd_soc_dai *dai)
{
struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai);

free_irq(mcpdm->irq, (void *)mcpdm);
pm_runtime_disable(mcpdm->dev);

return 0;
Expand Down Expand Up @@ -465,14 +464,11 @@ static int asoc_mcpdm_probe(struct platform_device *pdev)
if (res == NULL)
return -ENOMEM;

if (!devm_request_mem_region(&pdev->dev, res->start,
resource_size(res), "McPDM"))
return -EBUSY;

mcpdm->io_base = devm_ioremap(&pdev->dev, res->start,
resource_size(res));
if (!mcpdm->io_base)
mcpdm->io_base = devm_request_and_ioremap(&pdev->dev, res);
if (!mcpdm->io_base) {
dev_err(&pdev->dev, "cannot remap\n");
return -ENOMEM;
}

mcpdm->irq = platform_get_irq(pdev, 0);
if (mcpdm->irq < 0)
Expand Down

0 comments on commit ddd1753

Please sign in to comment.