diff options
author | Arve Hjønnevåg <arve@android.com> | 2011-01-28 23:12:32 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2012-02-14 11:30:39 -0800 |
commit | e4374a790af1934bd84274d315f6653bea33adcc (patch) | |
tree | 97fdbcf966b0f21d7dc29a4cc4bc813e9ab171e2 /arch | |
parent | b0a4a0d3d51ed0289d432bab8f014c276b0ab46b (diff) |
ARM: etm: Don't require clock control
If clk_get fail, assume the etb does not need a separate clock.
Change-Id: Ia0bf3f5391e94a60ea45876aa7afc8a88a7ec3bf
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/etm.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c index 36d20bd5012..bd295e8866a 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); |