From patchwork Mon Dec 24 08:33:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1908351 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id D3BCB40061 for ; Mon, 24 Dec 2012 09:42:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C23FEE6156 for ; Mon, 24 Dec 2012 01:42:27 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-da0-f47.google.com (mail-da0-f47.google.com [209.85.210.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CABDE5E0A for ; Mon, 24 Dec 2012 00:42:18 -0800 (PST) Received: by mail-da0-f47.google.com with SMTP id s35so3062399dak.6 for ; Mon, 24 Dec 2012 00:42:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=0ot/AB4BNiSjrpqPZsVkYASvgW9+eXPvv/evZmCcNMI=; b=AExTt5OKvQdkhjn9m+TfCqdEuaBpt/HagpBdGhT2AZmeHu9hjzH5AuQ0k+WterLXk4 97JqyaXfDyyb9QDhgg1BaU/UtFgn6MgfKWACr8Ol6Q0Tpwy3Lif3HD+pzZt34aZMejhQ HrETzhCjsZl0oFJgK7oz2G+7e4h5cccJtQxaSh06p8xA7Vq/jbTWxusfCzfRd/KDuNxi rT1DWwM04rai9VF1yF836hBxDXdQV/qEJVCMfVHD3H1P7iLaaEV3MynFomW41EoxDGr6 5rmqxVRKmEbQaBaIUtZb3nEF4NPSdNQvPC0m+4c3JcfPs7BNXsaY/t30kpxHBUk0Nvq4 cPew== X-Received: by 10.68.234.36 with SMTP id ub4mr65388780pbc.68.1356338538224; Mon, 24 Dec 2012 00:42:18 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id pv8sm11959096pbc.26.2012.12.24.00.42.14 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 00:42:17 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 05/10] drm/exynos: Remove unnecessary devm_* freeing APIs in exynos_drm_rotator.c Date: Mon, 24 Dec 2012 14:03:46 +0530 Message-Id: <1356338031-23674-6-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1356338031-23674-1-git-send-email-sachin.kamat@linaro.org> References: <1356338031-23674-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQlz9aGlwe1/o3yM/MFIL9MHA8B9bR3gckpWfzMyRegMvC9aZbm/tVOT3/xSmX/R/+qRPNxA X-Mailman-Approved-At: Mon, 24 Dec 2012 01:36:58 -0800 Cc: sachin.kamat@linaro.org, patches@linaro.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org 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 Signed-off-by: Sachin Kamat --- 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; }