Merge remote-tracking branch 'regulator/fix/core' into regulator-linus
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-omap1 / dma.c
index 1a4e887f028d59b9e4c84584a5fc5418a4693e41..a94b3a718d1a771dda53f5e06542fb6a6989cee8 100644 (file)
@@ -301,7 +301,7 @@ static int __init omap1_system_dma_init(void)
        if (ret) {
                dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
                        __func__, pdev->name, pdev->id);
-               goto exit_device_put;
+               goto exit_iounmap;
        }
 
        p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
@@ -309,7 +309,7 @@ static int __init omap1_system_dma_init(void)
                dev_err(&pdev->dev, "%s: Unable to allocate 'p' for %s\n",
                        __func__, pdev->name);
                ret = -ENOMEM;
-               goto exit_device_del;
+               goto exit_iounmap;
        }
 
        d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL);
@@ -345,6 +345,7 @@ static int __init omap1_system_dma_init(void)
                dev_err(&pdev->dev,
                        "%s: Memory allocation failed for d->chan!\n",
                        __func__);
+               ret = -ENOMEM;
                goto exit_release_d;
        }
 
@@ -402,8 +403,8 @@ exit_release_d:
        kfree(d);
 exit_release_p:
        kfree(p);
-exit_device_del:
-       platform_device_del(pdev);
+exit_iounmap:
+       iounmap(dma_base);
 exit_device_put:
        platform_device_put(pdev);