From patchwork Wed Jun 20 22:47:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 9526 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 A369923E1B for ; Wed, 20 Jun 2012 22:49:16 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7209AA18290 for ; Wed, 20 Jun 2012 22:49:16 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so6814232yen.11 for ; Wed, 20 Jun 2012 15:49:16 -0700 (PDT) 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 :mime-version:content-type:content-transfer-encoding :x-content-scanned:x-cbid:x-gm-message-state; bh=UlnWEasmEFrspm/md+ycSxog2DYIkrb5RbRJkBMOTBw=; b=OYsV1eNRZSXt0T5w5pZl+Y59qMM9exoP/EXzongUoFqBeqV2KEzDdaPpn8DFlmHEOp xz8NyfgzIjItfuFL4oKbwxMDmOk60vGk63TM91qwTb6zBmGNvZRsh3M47HoNis1fZYcg VuYuJG64q22ZtnakK0JJgAk1K5cfpyUiBoBT0pl0CgtJ9XIfhcIxPP4OJL2sXv5TDFyJ IrIAlupTIMhD134F4OBXAiFMquJGtdQHYP/GBjyigb2Dg4Lw4yUaJpXzRBtNinpVbDFD wUhnjCWm6bZdAAokkXQSs7impANsgWRMfg3ZZ9h1lRq6ja0YAj/eEabcKkGqnIDnSW1/ 2vww== Received: by 10.42.210.193 with SMTP id gl1mr11814030icb.57.1340232556050; Wed, 20 Jun 2012 15:49:16 -0700 (PDT) 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.231.24.148 with SMTP id v20csp204192ibb; Wed, 20 Jun 2012 15:49:15 -0700 (PDT) Received: by 10.100.231.2 with SMTP id d2mr9091301anh.41.1340232554924; Wed, 20 Jun 2012 15:49:14 -0700 (PDT) Received: from e38.co.us.ibm.com (e38.co.us.ibm.com. [32.97.110.159]) by mx.google.com with ESMTPS id x4si442218ank.25.2012.06.20.15.49.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jun 2012 15:49:14 -0700 (PDT) Received-SPF: neutral (google.com: 32.97.110.159 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=32.97.110.159; Authentication-Results: mx.google.com; spf=neutral (google.com: 32.97.110.159 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) smtp.mail=john.stultz@linaro.org Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Jun 2012 16:49:13 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 20 Jun 2012 16:49:11 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id A48391FF001B; Wed, 20 Jun 2012 22:48:31 +0000 (WET) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5KMmBiL203258; Wed, 20 Jun 2012 16:48:16 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5KMlt2T029004; Wed, 20 Jun 2012 16:47:56 -0600 Received: from kernel.stglabs.ibm.com (kernel.stglabs.ibm.com [9.114.214.19]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5KMls1v028868; Wed, 20 Jun 2012 16:47:55 -0600 From: John Stultz To: LKML Cc: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Russell King , Paul Gortmaker , Alexander Shishkin , John Stultz Subject: [PATCH 01/15] ARM: etm: Don't require clock control Date: Wed, 20 Jun 2012 18:47:33 -0400 Message-Id: <1340232467-6023-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1340232467-6023-1-git-send-email-john.stultz@linaro.org> References: <1340232467-6023-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12062022-5518-0000-0000-0000055C6170 X-Gm-Message-State: ALoCoQkvScBxmH+/zOlD2iE5Mr29vOpFNCm7paZHG/5ohNA2pD2jkPI66o5IQcTHKm/AoSieTzLO From: Arve Hjønnevåg If clk_get fail, assume the etb does not need a separate clock. CC: Russell King CC: Paul Gortmaker CC: Alexander Shishkin Acked-by: Alexander Shishkin Signed-off-by: Arve Hjønnevåg Signed-off-by: John Stultz --- arch/arm/kernel/etm.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c index 36d20bd..bd295e8 100644 --- a/arch/arm/kernel/etm.c +++ b/arch/arm/kernel/etm.c @@ -362,13 +362,12 @@ static int __devinit etb_probe(struct amba_device *dev, const 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); @@ -403,8 +402,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);