From: Arve Hjønnevåg Date: Sat, 29 Jan 2011 07:12:32 +0000 (-0800) Subject: ARM: etm: Don't require clock control X-Git-Tag: firefly_0821_release~4090^2~815 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7e27f7977b8249ae9e8f2f1a16a1f15702d33f66;p=firefly-linux-kernel-4.4.55.git 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 --- diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c index 8ff0ecdc637f..cb65339e4a3c 100644 --- a/arch/arm/kernel/etm.c +++ b/arch/arm/kernel/etm.c @@ -362,13 +362,12 @@ static int 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);