[PATCH 05/10] drm/exynos: Remove unnecessary devm_* freeing APIs in exynos_drm_rotator.c

Sachin Kamat sachin.kamat at linaro.org
Mon Dec 24 00:33:46 PST 2012


devm_* APIs are device managed and get freed automatically when the
device detaches. Thus explicit freeing is not needed. This saves some
code.

Cc: Eunchul Kim <chulspro.kim at samsung.com>
Signed-off-by: Sachin Kamat <sachin.kamat at linaro.org>
---
 drivers/gpu/drm/exynos/exynos_drm_rotator.c |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
index 1c23660..0f168449 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c
@@ -657,29 +657,26 @@ static int __devinit rotator_probe(struct platform_device *pdev)
 	rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!rot->regs_res) {
 		dev_err(dev, "failed to find registers\n");
-		ret = -ENOENT;
-		goto err_get_resource;
+		return -ENOENT;
 	}
 
 	rot->regs = devm_request_and_ioremap(dev, rot->regs_res);
 	if (!rot->regs) {
 		dev_err(dev, "failed to map register\n");
-		ret = -ENXIO;
-		goto err_get_resource;
+		return -ENXIO;
 	}
 
 	rot->irq = platform_get_irq(pdev, 0);
 	if (rot->irq < 0) {
 		dev_err(dev, "failed to get irq\n");
-		ret = rot->irq;
-		goto err_get_irq;
+		return rot->irq;
 	}
 
 	ret = request_threaded_irq(rot->irq, NULL, rotator_irq_handler,
 			IRQF_ONESHOT, "drm_rotator", rot);
 	if (ret < 0) {
 		dev_err(dev, "failed to request irq\n");
-		goto err_get_irq;
+		return ret;
 	}
 
 	rot->clock = clk_get(dev, "rotator");
@@ -723,10 +720,6 @@ err_ippdrv_register:
 	clk_put(rot->clock);
 err_clk_get:
 	free_irq(rot->irq, rot);
-err_get_irq:
-	devm_iounmap(dev, rot->regs);
-err_get_resource:
-	devm_kfree(dev, rot);
 	return ret;
 }
 
@@ -743,9 +736,6 @@ static int __devexit rotator_remove(struct platform_device *pdev)
 	clk_put(rot->clock);
 
 	free_irq(rot->irq, rot);
-	devm_iounmap(dev, rot->regs);
-
-	devm_kfree(dev, rot);
 
 	return 0;
 }
-- 
1.7.4.1



More information about the dri-devel mailing list