[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1340232467-6023-2-git-send-email-john.stultz@linaro.org>
Date: Wed, 20 Jun 2012 18:47:33 -0400
From: John Stultz <john.stultz@...aro.org>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Arve Hjønnevåg <arve@...roid.com>,
Russell King <linux@....linux.org.uk>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
John Stultz <john.stultz@...aro.org>
Subject: [PATCH 01/15] ARM: etm: Don't require clock control
From: Arve Hjønnevåg <arve@...roid.com>
If clk_get fail, assume the etb does not need a separate clock.
CC: Russell King <linux@....linux.org.uk>
CC: Paul Gortmaker <paul.gortmaker@...driver.com>
CC: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Acked-by: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Signed-off-by: Arve Hjønnevåg <arve@...roid.com>
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
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);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists