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: 15664 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Tcqjl-0006DH-Ru for patchwork@linuxtv.org; Mon, 26 Nov 2012 05:56:05 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp for id 1Tcqjl-00057M-AQ; Mon, 26 Nov 2012 05:56:05 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754372Ab2KZE4C (ORCPT ); Sun, 25 Nov 2012 23:56:02 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:63121 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754351Ab2KZE4B (ORCPT ); Sun, 25 Nov 2012 23:56:01 -0500 Received: by mail-pb0-f46.google.com with SMTP id wy7so7718146pbc.19 for ; Sun, 25 Nov 2012 20:56:00 -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=bgPmCGlNy3SJ202K6wZojye1gYqNtYWnOh9bYbE4X38=; b=Aa+5tTbmqJWJN3b+E7MgrD+ZjLhK6DsFzkWw3wIM5qIBrcVG0nwrcppQjB4oMhY9RK 3MIj+OgBNGcS/t2ib7PhSpWKVvXh+62DOEgPFBUHZxsE9EUx9S07YT4cREaOmWlpRr/R +atnrjbmTUluu9bY4ZfO42l7oZ5fe/9MWi/KsF+W1Mjt8Qg0UIHUCPUENE1IcEEMV6+C K+mcB+wsBJatNmXhnbkvu+XspmU7Irv26AgHs4tA6Sr4KAOgZIUUhGDRMUbgTfwOMoso 9B3RCU9FlhVW9apT8sCipdJjjh2Ji/2JXCiBBf1fmPkqEbxnjVivHsbv9mBZy7Ps9OU6 xurQ== 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: ALoCoQmQhrGG2po7ERI1/lRpuqXItZgRqUVxfKt11lPVIIGY4n19wwuYeP/vVhyfbATwUjP8iEtZ Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.11.26.44816 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __INT_PROD_TV 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' 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;