From patchwork Fri Nov 23 03:41:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1793891 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 11C26DF230 for ; Fri, 23 Nov 2012 06:39:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10B7E43681 for ; Thu, 22 Nov 2012 22:39:17 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 8162BE5F37 for ; Thu, 22 Nov 2012 19:48:29 -0800 (PST) Received: by mail-pa0-f49.google.com with SMTP id bi1so3060302pad.36 for ; Thu, 22 Nov 2012 19:48:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=tx6FSGfB6j6QF2GpV2fiLc2FXO+zoNS8PFwDrhjf/SA=; b=X77NKAFpd26b0olzWsPhVF/h3U7CE/pVG1HHfNdP11VMhTNh51UY7nbDNB9j/HmZVe /aDmC/juaB6q4BB6eHqeNRHDkXIjInywk8i6UkhbT5/zSeXhH97hZXSE3xU9GhcyYAva U56Bkb+pn5K5KdLcxf9Vyg2nfTC1+tIExMTjXMTTR+E3JwWvC0mCHxcUce1cke/6OmLo EeesggYkNbycHokDsXBcQArN1x2bfCvANWNM2qKmG3NBslfXHF5LYzgGx8KZLkqHflVk ng4+FUI8h9WZCAIR2glx2Y8q7pU9lMZiT3lOIlCnZLjbK+v8UkFlvKgmfEbmah+PtkLe 8ttA== Received: by 10.66.73.226 with SMTP id o2mr6669732pav.83.1353642509573; Thu, 22 Nov 2012 19:48:29 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id x8sm2937337paw.16.2012.11.22.19.48.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 19:48:29 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/5] drm/exynos: Use devm_clk_get in exynos_mixer.c Date: Fri, 23 Nov 2012 09:11:57 +0530 Message-Id: <1353642119-10253-4-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353642119-10253-1-git-send-email-sachin.kamat@linaro.org> References: <1353642119-10253-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQm/f/7LGdpE7j6CRLuNOwP6wdjCakiubPCFf/OfWxtNvig6JM6/Z7cZtazDg5l9JtfFkfpj X-Mailman-Approved-At: Thu, 22 Nov 2012 22:38:55 -0800 Cc: patches@linaro.org, sachin.kamat@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_clk_get is device managed and makes error handling and exit code simpler. Signed-off-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_mixer.c | 20 +++++--------------- 1 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 0d3ed28..88fcb40 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -962,14 +962,14 @@ static int __devinit mixer_resources_init(struct exynos_drm_hdmi_context *ctx, spin_lock_init(&mixer_res->reg_slock); - mixer_res->mixer = clk_get(dev, "mixer"); + mixer_res->mixer = devm_clk_get(dev, "mixer"); if (IS_ERR_OR_NULL(mixer_res->mixer)) { dev_err(dev, "failed to get clock 'mixer'\n"); ret = -ENODEV; goto fail; } - mixer_res->sclk_hdmi = clk_get(dev, "sclk_hdmi"); + mixer_res->sclk_hdmi = devm_clk_get(dev, "sclk_hdmi"); if (IS_ERR_OR_NULL(mixer_res->sclk_hdmi)) { dev_err(dev, "failed to get clock 'sclk_hdmi'\n"); ret = -ENODEV; @@ -1008,10 +1008,6 @@ static int __devinit mixer_resources_init(struct exynos_drm_hdmi_context *ctx, return 0; fail: - if (!IS_ERR_OR_NULL(mixer_res->sclk_hdmi)) - clk_put(mixer_res->sclk_hdmi); - if (!IS_ERR_OR_NULL(mixer_res->mixer)) - clk_put(mixer_res->mixer); return ret; } @@ -1024,19 +1020,19 @@ static int __devinit vp_resources_init(struct exynos_drm_hdmi_context *ctx, struct resource *res; int ret; - mixer_res->vp = clk_get(dev, "vp"); + mixer_res->vp = devm_clk_get(dev, "vp"); if (IS_ERR_OR_NULL(mixer_res->vp)) { dev_err(dev, "failed to get clock 'vp'\n"); ret = -ENODEV; goto fail; } - mixer_res->sclk_mixer = clk_get(dev, "sclk_mixer"); + mixer_res->sclk_mixer = devm_clk_get(dev, "sclk_mixer"); if (IS_ERR_OR_NULL(mixer_res->sclk_mixer)) { dev_err(dev, "failed to get clock 'sclk_mixer'\n"); ret = -ENODEV; goto fail; } - mixer_res->sclk_dac = clk_get(dev, "sclk_dac"); + mixer_res->sclk_dac = devm_clk_get(dev, "sclk_dac"); if (IS_ERR_OR_NULL(mixer_res->sclk_dac)) { dev_err(dev, "failed to get clock 'sclk_dac'\n"); ret = -ENODEV; @@ -1064,12 +1060,6 @@ static int __devinit vp_resources_init(struct exynos_drm_hdmi_context *ctx, return 0; fail: - if (!IS_ERR_OR_NULL(mixer_res->sclk_dac)) - clk_put(mixer_res->sclk_dac); - if (!IS_ERR_OR_NULL(mixer_res->sclk_mixer)) - clk_put(mixer_res->sclk_mixer); - if (!IS_ERR_OR_NULL(mixer_res->vp)) - clk_put(mixer_res->vp); return ret; }