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: 13688 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6474723EC8 for ; Mon, 24 Dec 2012 08:42:20 +0000 (UTC) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by fiordland.canonical.com (Postfix) with ESMTP id 22592A18DC6 for ; Mon, 24 Dec 2012 08:42:20 +0000 (UTC) Received: by mail-vc0-f177.google.com with SMTP id m8so7250129vcd.36 for ; Mon, 24 Dec 2012 00:42:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf: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=VwGPLjyr3C4F+lnlBpXRs7L81sHkNbcHJwk0KxNTsCljP+5GjM6mfGVxgcw9hQ4csV fxfflVFgaxekkDgGqCWD0sDkEjd3U/T4F3spBKhzPKNZy5j0/SqNi/PsX+vH9m3Q79m2 lSXne22cgB1ubwA/FyX7ZAk52mSsIXNvwrR7hmFQHUQjsktJSyUNqHHgJ1JIy9L50IsW m/yCPOVGp1j9MvIi28H5vgnASOhiaTSvT8GodsUGFDnwxmbSttIy4FzZol5UJSHdDknd leBdD7xjntbQmIaBCMqoBFFvd8VH8xgb9rPzNJM1oM2auvDQhfxKxR04f1mIgAM6LVwo hntA== X-Received: by 10.220.8.18 with SMTP id f18mr29718925vcf.14.1356338539643; Mon, 24 Dec 2012 00:42:19 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.49.133 with SMTP id u5csp184121ven; Mon, 24 Dec 2012 00:42:19 -0800 (PST) X-Received: by 10.66.74.170 with SMTP id u10mr61197186pav.41.1356338538595; Mon, 24 Dec 2012 00:42:18 -0800 (PST) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id ah7si19787465pbd.13.2012.12.24.00.42.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 00:42:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.44; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pb0-f44.google.com with SMTP id uo1so3851101pbc.31 for ; Mon, 24 Dec 2012 00:42:18 -0800 (PST) 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 Cc: inki.dae@samsung.com, sachin.kamat@linaro.org, patches@linaro.org, airlied@linux.ie, Eunchul Kim 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: ALoCoQnoZ8KjtoW+lbc4oMLr4EFnier/cUEj/Ay8T1ZmEc98llxbn3lObyj9xsmNS/eZ3cQrdcNM 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; }