diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2015-04-09 13:56:41 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-04-10 06:05:25 -0400 |
commit | 299e7e97cc33d2d8894250ae2a3101bfb5670141 (patch) | |
tree | 78ffda3d4fc4b2c071b77a7cd47b97bb85904966 | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
ASoC: fsl_ssi: Use devm_snd_soc_register_component()
Using devm_snd_soc_register_component() can make the code shorter and
cleaner.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 2595611e8a6d..4201bfe2e9b9 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -1390,8 +1390,8 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1390 | return ret; | 1390 | return ret; |
1391 | } | 1391 | } |
1392 | 1392 | ||
1393 | ret = snd_soc_register_component(&pdev->dev, &fsl_ssi_component, | 1393 | ret = devm_snd_soc_register_component(&pdev->dev, &fsl_ssi_component, |
1394 | &ssi_private->cpu_dai_drv, 1); | 1394 | &ssi_private->cpu_dai_drv, 1); |
1395 | if (ret) { | 1395 | if (ret) { |
1396 | dev_err(&pdev->dev, "failed to register DAI: %d\n", ret); | 1396 | dev_err(&pdev->dev, "failed to register DAI: %d\n", ret); |
1397 | goto error_asoc_register; | 1397 | goto error_asoc_register; |
@@ -1404,13 +1404,13 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1404 | if (ret < 0) { | 1404 | if (ret < 0) { |
1405 | dev_err(&pdev->dev, "could not claim irq %u\n", | 1405 | dev_err(&pdev->dev, "could not claim irq %u\n", |
1406 | ssi_private->irq); | 1406 | ssi_private->irq); |
1407 | goto error_irq; | 1407 | goto error_asoc_register; |
1408 | } | 1408 | } |
1409 | } | 1409 | } |
1410 | 1410 | ||
1411 | ret = fsl_ssi_debugfs_create(&ssi_private->dbg_stats, &pdev->dev); | 1411 | ret = fsl_ssi_debugfs_create(&ssi_private->dbg_stats, &pdev->dev); |
1412 | if (ret) | 1412 | if (ret) |
1413 | goto error_irq; | 1413 | goto error_asoc_register; |
1414 | 1414 | ||
1415 | /* | 1415 | /* |
1416 | * If codec-handle property is missing from SSI node, we assume | 1416 | * If codec-handle property is missing from SSI node, we assume |
@@ -1451,9 +1451,6 @@ done: | |||
1451 | error_sound_card: | 1451 | error_sound_card: |
1452 | fsl_ssi_debugfs_remove(&ssi_private->dbg_stats); | 1452 | fsl_ssi_debugfs_remove(&ssi_private->dbg_stats); |
1453 | 1453 | ||
1454 | error_irq: | ||
1455 | snd_soc_unregister_component(&pdev->dev); | ||
1456 | |||
1457 | error_asoc_register: | 1454 | error_asoc_register: |
1458 | if (ssi_private->soc->imx) | 1455 | if (ssi_private->soc->imx) |
1459 | fsl_ssi_imx_clean(pdev, ssi_private); | 1456 | fsl_ssi_imx_clean(pdev, ssi_private); |
@@ -1469,7 +1466,6 @@ static int fsl_ssi_remove(struct platform_device *pdev) | |||
1469 | 1466 | ||
1470 | if (ssi_private->pdev) | 1467 | if (ssi_private->pdev) |
1471 | platform_device_unregister(ssi_private->pdev); | 1468 | platform_device_unregister(ssi_private->pdev); |
1472 | snd_soc_unregister_component(&pdev->dev); | ||
1473 | 1469 | ||
1474 | if (ssi_private->soc->imx) | 1470 | if (ssi_private->soc->imx) |
1475 | fsl_ssi_imx_clean(pdev, ssi_private); | 1471 | fsl_ssi_imx_clean(pdev, ssi_private); |