From patchwork Mon Nov 26 04:49:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13194 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 A527323EFB for ; Mon, 26 Nov 2012 04:56:01 +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 64325A192BA for ; Mon, 26 Nov 2012 04:56:01 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so4033426ieb.11 for ; Sun, 25 Nov 2012 20:56:01 -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=bgPmCGlNy3SJ202K6wZojye1gYqNtYWnOh9bYbE4X38=; b=nslYSvcB/iUUmHm+wZDVN4jnb3vRsrEGpoRrcBGupeoG4YBuhtgZJTKFkXwGTwkp/A PUEbmJwRz5bp4XDsKbNsxYATq4t1WwXzCfTfbAXEAJO1T7fVnaB0/pMR2xWDvxiyF/lA n5vZQUQmR+K8Vh72ORDEhFxA1ODquMlQ6iZ9QsAsQ0TM3z2ccyRRT4B0R6S7UkHgOduN etbzLRbT79vCxOQlZ8F4Vzn3kEvKyslyN1OvH5ORpvJDxC2nRc0xZThZj1GP5xL9AqYq iTIFkc9xk3qjeZH9ljom6NkZ8zQxaF7O79a0XHASAAchRqgvfwrdK0y3Z4uNKEXA3dEX ReUw== Received: by 10.43.125.133 with SMTP id gs5mr8763839icc.54.1353905761166; Sun, 25 Nov 2012 20:56:01 -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 n20csp201173igt; Sun, 25 Nov 2012 20:56:00 -0800 (PST) Received: by 10.68.241.133 with SMTP id wi5mr34126063pbc.48.1353905760681; Sun, 25 Nov 2012 20:56:00 -0800 (PST) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id zw4si17968864pbc.124.2012.11.25.20.56.00 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 25 Nov 2012 20:56:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.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-pb0-f41.google.com with SMTP id xa7so7947486pbc.0 for ; Sun, 25 Nov 2012 20:56:00 -0800 (PST) Received: by 10.68.244.6 with SMTP id xc6mr34308257pbc.94.1353905760450; Sun, 25 Nov 2012 20:56:00 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id g1sm8082844pax.21.2012.11.25.20.55.57 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 25 Nov 2012 20:55:59 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: t.stanislaws@samsung.com, s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 9/9] [media] s5p-tv: Use devm_clk_get APIs in hdmi_drv Date: Mon, 26 Nov 2012 10:19:08 +0530 Message-Id: <1353905348-15475-10-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353905348-15475-1-git-send-email-sachin.kamat@linaro.org> References: <1353905348-15475-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQkwBJhD713Ozid6oj8GXV5wFU5ASRHSBK3RGUM7/Hv17g3ew0n5lfzupRhhjM/BjtoUhUc9 devm_clk_get() is device managed and makes error handling and cleanup a bit simpler. Signed-off-by: Sachin Kamat --- drivers/media/platform/s5p-tv/hdmi_drv.c | 20 +++++--------------- 1 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c b/drivers/media/platform/s5p-tv/hdmi_drv.c index c48eadf..ae3bc28 100644 --- a/drivers/media/platform/s5p-tv/hdmi_drv.c +++ b/drivers/media/platform/s5p-tv/hdmi_drv.c @@ -750,16 +750,6 @@ static void hdmi_resources_cleanup(struct hdmi_device *hdev) regulator_bulk_free(res->regul_count, res->regul_bulk); /* kfree is NULL-safe */ kfree(res->regul_bulk); - if (!IS_ERR_OR_NULL(res->hdmiphy)) - clk_put(res->hdmiphy); - if (!IS_ERR_OR_NULL(res->sclk_hdmiphy)) - clk_put(res->sclk_hdmiphy); - if (!IS_ERR_OR_NULL(res->sclk_pixel)) - clk_put(res->sclk_pixel); - if (!IS_ERR_OR_NULL(res->sclk_hdmi)) - clk_put(res->sclk_hdmi); - if (!IS_ERR_OR_NULL(res->hdmi)) - clk_put(res->hdmi); memset(res, 0, sizeof(*res)); } @@ -780,27 +770,27 @@ static int hdmi_resources_init(struct hdmi_device *hdev) memset(res, 0, sizeof(*res)); /* get clocks, power */ - res->hdmi = clk_get(dev, "hdmi"); + res->hdmi = devm_clk_get(dev, "hdmi"); if (IS_ERR_OR_NULL(res->hdmi)) { dev_err(dev, "failed to get clock 'hdmi'\n"); goto fail; } - res->sclk_hdmi = clk_get(dev, "sclk_hdmi"); + res->sclk_hdmi = devm_clk_get(dev, "sclk_hdmi"); if (IS_ERR_OR_NULL(res->sclk_hdmi)) { dev_err(dev, "failed to get clock 'sclk_hdmi'\n"); goto fail; } - res->sclk_pixel = clk_get(dev, "sclk_pixel"); + res->sclk_pixel = devm_clk_get(dev, "sclk_pixel"); if (IS_ERR_OR_NULL(res->sclk_pixel)) { dev_err(dev, "failed to get clock 'sclk_pixel'\n"); goto fail; } - res->sclk_hdmiphy = clk_get(dev, "sclk_hdmiphy"); + res->sclk_hdmiphy = devm_clk_get(dev, "sclk_hdmiphy"); if (IS_ERR_OR_NULL(res->sclk_hdmiphy)) { dev_err(dev, "failed to get clock 'sclk_hdmiphy'\n"); goto fail; } - res->hdmiphy = clk_get(dev, "hdmiphy"); + res->hdmiphy = devm_clk_get(dev, "hdmiphy"); if (IS_ERR_OR_NULL(res->hdmiphy)) { dev_err(dev, "failed to get clock 'hdmiphy'\n"); goto fail;