aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/ux500/ux500_msp_i2s.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/ux500/ux500_msp_i2s.c')
-rw-r--r--sound/soc/ux500/ux500_msp_i2s.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/sound/soc/ux500/ux500_msp_i2s.c b/sound/soc/ux500/ux500_msp_i2s.c
index 5c472f335a64..eb85113d472a 100644
--- a/sound/soc/ux500/ux500_msp_i2s.c
+++ b/sound/soc/ux500/ux500_msp_i2s.c
@@ -663,7 +663,6 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
663 struct ux500_msp **msp_p, 663 struct ux500_msp **msp_p,
664 struct msp_i2s_platform_data *platform_data) 664 struct msp_i2s_platform_data *platform_data)
665{ 665{
666 int ret = 0;
667 struct resource *res = NULL; 666 struct resource *res = NULL;
668 struct i2s_controller *i2s_cont; 667 struct i2s_controller *i2s_cont;
669 struct ux500_msp *msp; 668 struct ux500_msp *msp;
@@ -685,15 +684,14 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
685 if (res == NULL) { 684 if (res == NULL) {
686 dev_err(&pdev->dev, "%s: ERROR: Unable to get resource!\n", 685 dev_err(&pdev->dev, "%s: ERROR: Unable to get resource!\n",
687 __func__); 686 __func__);
688 ret = -ENOMEM; 687 return -ENOMEM;
689 goto err_res;
690 } 688 }
691 689
692 msp->registers = ioremap(res->start, (res->end - res->start + 1)); 690 msp->registers = devm_ioremap(&pdev->dev, res->start,
691 resource_size(res));
693 if (msp->registers == NULL) { 692 if (msp->registers == NULL) {
694 dev_err(&pdev->dev, "%s: ERROR: ioremap failed!\n", __func__); 693 dev_err(&pdev->dev, "%s: ERROR: ioremap failed!\n", __func__);
695 ret = -ENOMEM; 694 return -ENOMEM;
696 goto err_res;
697 } 695 }
698 696
699 msp->msp_state = MSP_STATE_IDLE; 697 msp->msp_state = MSP_STATE_IDLE;
@@ -705,7 +703,7 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
705 dev_err(&pdev->dev, 703 dev_err(&pdev->dev,
706 "%s: ERROR: Failed to allocate I2S-controller!\n", 704 "%s: ERROR: Failed to allocate I2S-controller!\n",
707 __func__); 705 __func__);
708 goto err_i2s_cont; 706 return -ENOMEM;
709 } 707 }
710 i2s_cont->dev.parent = &pdev->dev; 708 i2s_cont->dev.parent = &pdev->dev;
711 i2s_cont->data = (void *)msp; 709 i2s_cont->data = (void *)msp;
@@ -716,14 +714,6 @@ int ux500_msp_i2s_init_msp(struct platform_device *pdev,
716 msp->i2s_cont = i2s_cont; 714 msp->i2s_cont = i2s_cont;
717 715
718 return 0; 716 return 0;
719
720err_i2s_cont:
721 iounmap(msp->registers);
722
723err_res:
724 devm_kfree(&pdev->dev, msp);
725
726 return ret;
727} 717}
728 718
729void ux500_msp_i2s_cleanup_msp(struct platform_device *pdev, 719void ux500_msp_i2s_cleanup_msp(struct platform_device *pdev,
@@ -732,11 +722,6 @@ void ux500_msp_i2s_cleanup_msp(struct platform_device *pdev,
732 dev_dbg(msp->dev, "%s: Enter (id = %d).\n", __func__, msp->id); 722 dev_dbg(msp->dev, "%s: Enter (id = %d).\n", __func__, msp->id);
733 723
734 device_unregister(&msp->i2s_cont->dev); 724 device_unregister(&msp->i2s_cont->dev);
735 devm_kfree(&pdev->dev, msp->i2s_cont);
736
737 iounmap(msp->registers);
738
739 devm_kfree(&pdev->dev, msp);
740} 725}
741 726
742MODULE_LICENSE("GPL v2"); 727MODULE_LICENSE("GPL v2");