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: 13108 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 E7D9D23FC1 for ; Fri, 23 Nov 2012 03:48:30 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id AABC7A19E6B for ; Fri, 23 Nov 2012 03:48:30 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1335312ieb.11 for ; Thu, 22 Nov 2012 19:48:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=tx6FSGfB6j6QF2GpV2fiLc2FXO+zoNS8PFwDrhjf/SA=; b=iVPwWaG95OFVu5q2YzP7hrDhcDzFjd06RytbCcK+4QB0FlvZaD9wYjL94m1SXDs4om l4Bw5Gmh647mQg8TZfpOatjqEphPiJsg4w245EFGv/0JnWRZAjNPECtTHaUZj4zv2Hdw DgwWdf8vEQNuKY4YzCESs1QuSBoFXF9ULFYirHHQ9vhNNYLdPEUAlr4y+8dPbaJLDITx rPb/TT7PvJdtkFNg+vMnf5SEqa1t6ngI69KpltCWBTCTzcg/XyKXe+BisgcLDouuK5xx FGRaRJ6cpn2BJ+pkmgX3XA8RvLmepj9rA8U2cLsJshOS7SfLSTmhrHfNZ9Jnu7eUA3OL ytMQ== Received: by 10.50.173.34 with SMTP id bh2mr2310640igc.70.1353642510384; Thu, 22 Nov 2012 19:48:30 -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.50.67.148 with SMTP id n20csp296295igt; Thu, 22 Nov 2012 19:48:30 -0800 (PST) Received: by 10.66.88.196 with SMTP id bi4mr7013364pab.16.1353642509859; Thu, 22 Nov 2012 19:48:29 -0800 (PST) Received: from mail-da0-f41.google.com (mail-da0-f41.google.com [209.85.210.41]) by mx.google.com with ESMTPS id j9si6806205pay.173.2012.11.22.19.48.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 19:48:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.41 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.41 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-da0-f41.google.com with SMTP id e20so2046239dak.28 for ; Thu, 22 Nov 2012 19:48:29 -0800 (PST) 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 Cc: inki.dae@samsung.com, jy0922.shim@samsung.com, airlied@linux.ie, sachin.kamat@linaro.org, patches@linaro.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: ALoCoQmnOJAAPP1GWMNeXbwB6ufVonSN90llb4FPTZxOrv6XgaK+RdSkBrF4fvA0jlIe46zzQOp3 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; }