From patchwork Tue Feb 15 06:11:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Arve_Hj=C3=B8nnev=C3=A5g?= X-Patchwork-Id: 557681 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1F6BotC004535 for ; Tue, 15 Feb 2011 06:11:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027Ab1BOGLr (ORCPT ); Tue, 15 Feb 2011 01:11:47 -0500 Received: from mail-pw0-f46.google.com ([209.85.160.46]:45219 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268Ab1BOGLq (ORCPT ); Tue, 15 Feb 2011 01:11:46 -0500 Received: by pwj3 with SMTP id 3so25038pwj.19 for ; Mon, 14 Feb 2011 22:11:46 -0800 (PST) Received: by 10.142.178.6 with SMTP id a6mr3903225wff.437.1297750306305; Mon, 14 Feb 2011 22:11:46 -0800 (PST) Received: from localhost.localdomain (arve.mtv.corp.google.com [172.18.103.168]) by mx.google.com with ESMTPS id v19sm5222219wfh.0.2011.02.14.22.11.43 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Feb 2011 22:11:44 -0800 (PST) From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= To: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Russell King , Alexander Shishkin , Jason Wessel , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH 1/8] ARM: etm: Don't require clock control Date: Mon, 14 Feb 2011 22:11:09 -0800 Message-Id: <1297750276-12475-1-git-send-email-arve@android.com> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1296701663-12168-1-git-send-email-arve@android.com> References: <1296701663-12168-1-git-send-email-arve@android.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 15 Feb 2011 06:11:50 +0000 (UTC) diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c index 11db628..d4ec368 100644 --- a/arch/arm/kernel/etm.c +++ b/arch/arm/kernel/etm.c @@ -361,13 +361,12 @@ static int __init etb_probe(struct amba_device *dev, struct amba_id *id) if (ret) goto out_unmap; + /* Get optional clock. Currently used to select clock source on omap3 */ t->emu_clk = clk_get(&dev->dev, "emu_src_ck"); - if (IS_ERR(t->emu_clk)) { + if (IS_ERR(t->emu_clk)) dev_dbg(&dev->dev, "Failed to obtain emu_src_ck.\n"); - return -EFAULT; - } - - clk_enable(t->emu_clk); + else + clk_enable(t->emu_clk); etb_unlock(t); t->etb_bufsz = etb_readl(t, ETBR_DEPTH); @@ -402,8 +401,10 @@ static int etb_remove(struct amba_device *dev) iounmap(t->etb_regs); t->etb_regs = NULL; - clk_disable(t->emu_clk); - clk_put(t->emu_clk); + if (!IS_ERR(t->emu_clk)) { + clk_disable(t->emu_clk); + clk_put(t->emu_clk); + } amba_release_regions(dev);