From patchwork Tue Apr 2 11:33:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2377461 Return-Path: X-Original-To: patchwork-linux-fbdev@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 242C83FDDA for ; Tue, 2 Apr 2013 11:45:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761221Ab3DBLpo (ORCPT ); Tue, 2 Apr 2013 07:45:44 -0400 Received: from mail-pb0-f49.google.com ([209.85.160.49]:44458 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760173Ab3DBLpk (ORCPT ); Tue, 2 Apr 2013 07:45:40 -0400 Received: by mail-pb0-f49.google.com with SMTP id um15so196638pbc.22 for ; Tue, 02 Apr 2013 04:45:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=mNeO0XUUBWFOG2DR6EmBN+vnjifurPZMUufYb5yYsDM=; b=d784pyYayX1zvbfQ09DZCH+9VjJbKAnoGq4KlquX3ObVWPsIPmaIP6xfekrrQsNEJI AcH44wqfw6LIcz1WnP+1CT5ajJF3UIrrf+SHe+h0PjKZ+Bhe4XMEvAVdSAZow+r6uhgE 7aXO8D88yBmkLMRUZOIYjJN3M0R737c9qKL4OAs62Yd+RrPZ1/QufR+LU+iwin47TuZi LHl2FgoaWX0+QnO/U6naq6g1d0E/ysoci0Et6iPspESYiE5o68Mf8AP+z50MoU/Xx8E4 U9QQqVIhxomV+UXkRKRn8xJjdOa5PFlgxPon42J62KZJgubBLt31DoK0QsGJMBxXQ+oh /jZQ== X-Received: by 10.68.211.201 with SMTP id ne9mr16125323pbc.117.1364903140425; Tue, 02 Apr 2013 04:45:40 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id 1sm1445453pba.32.2013.04.02.04.45.32 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Apr 2013 04:45:39 -0700 (PDT) From: Sachin Kamat To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: tomi.valkeinen@ti.com, FlorianSchandinat@gmx.de, akpm@linux-foundation.org, sachin.kamat@linaro.org Subject: [PATCH 1/1] OMAPDSS: DSI: Use devm_clk_get() Date: Tue, 2 Apr 2013 17:03:23 +0530 Message-Id: <1364902403-9980-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQklTGp0XJl43/vNPVG46veyuPjoCx8bN2D1RX+JlzcBBiMKSQQp68krEHkM1n5tgmiUh1O0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Using devm_clk_get cleans up some code. Signed-off-by: Sachin Kamat --- Compile tested on linux-next tree (20130402). --- drivers/video/omap2/dss/dsi.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 8db29bf..9b1c5ec 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -5347,7 +5347,7 @@ static int dsi_get_clocks(struct platform_device *dsidev) struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); struct clk *clk; - clk = clk_get(&dsidev->dev, "fck"); + clk = devm_clk_get(&dsidev->dev, "fck"); if (IS_ERR(clk)) { DSSERR("can't get fck\n"); return PTR_ERR(clk); @@ -5355,11 +5355,9 @@ static int dsi_get_clocks(struct platform_device *dsidev) dsi->dss_clk = clk; - clk = clk_get(&dsidev->dev, "sys_clk"); + clk = devm_clk_get(&dsidev->dev, "sys_clk"); if (IS_ERR(clk)) { DSSERR("can't get sys_clk\n"); - clk_put(dsi->dss_clk); - dsi->dss_clk = NULL; return PTR_ERR(clk); } @@ -5368,16 +5366,6 @@ static int dsi_get_clocks(struct platform_device *dsidev) return 0; } -static void dsi_put_clocks(struct platform_device *dsidev) -{ - struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); - - if (dsi->dss_clk) - clk_put(dsi->dss_clk); - if (dsi->sys_clk) - clk_put(dsi->sys_clk); -} - static struct omap_dss_device * __init dsi_find_dssdev(struct platform_device *pdev) { struct omap_dss_board_info *pdata = pdev->dev.platform_data; @@ -5592,7 +5580,6 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev) err_runtime_get: pm_runtime_disable(&dsidev->dev); - dsi_put_clocks(dsidev); return r; } @@ -5608,8 +5595,6 @@ static int __exit omap_dsihw_remove(struct platform_device *dsidev) pm_runtime_disable(&dsidev->dev); - dsi_put_clocks(dsidev); - if (dsi->vdds_dsi_reg != NULL) { if (dsi->vdds_dsi_enabled) { regulator_disable(dsi->vdds_dsi_reg);