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: 1800421 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5CB4F3FC54 for ; Mon, 26 Nov 2012 04:56:06 +0000 (UTC) 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 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;