diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2013-11-26 22:00:32 +0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-11-26 22:00:32 +0400 |
commit | 70fe8217e17ddd058f9f043ae1cc0d86b1658a5c (patch) | |
tree | faa7a9ebc5bdc024eb4d5f107283ad94b44cf529 /drivers | |
parent | 4be77398ac9d948773116b6be4a3c91b3d6ea18c (diff) | |
parent | 77f7ce9a9f636daaa65731a833bae1311a7b80e5 (diff) | |
download | linux-70fe8217e17ddd058f9f043ae1cc0d86b1658a5c.tar.xz |
Merge branch 'clockevents/fixes' of git://git.linaro.org/people/dlezcano/linux into timers/urgent
* Hide event stream Kconfig option for the arch_arm_timer for ARM=n
* Fix a missing a clk_put in case the registering of the sh_mtu[2] drivers fails.
* Reuse clockevents_config_and_register for the at91rm9200_time timer
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clocksource/Kconfig | 1 | ||||
-rw-r--r-- | drivers/clocksource/sh_mtu2.c | 16 | ||||
-rw-r--r-- | drivers/clocksource/sh_tmu.c | 20 |
3 files changed, 32 insertions, 5 deletions
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index bdb953e15d2a..5c07a56962db 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -87,6 +87,7 @@ config ARM_ARCH_TIMER config ARM_ARCH_TIMER_EVTSTREAM bool "Support for ARM architected timer event stream generation" default y if ARM_ARCH_TIMER + depends on ARM_ARCH_TIMER help This option enables support for event stream generation based on the ARM architected timer. It is used for waking up CPUs executing diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c index 4aac9ee0d0c0..3cf12834681e 100644 --- a/drivers/clocksource/sh_mtu2.c +++ b/drivers/clocksource/sh_mtu2.c @@ -313,8 +313,20 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev) goto err1; } - return sh_mtu2_register(p, (char *)dev_name(&p->pdev->dev), - cfg->clockevent_rating); + ret = clk_prepare(p->clk); + if (ret < 0) + goto err2; + + ret = sh_mtu2_register(p, (char *)dev_name(&p->pdev->dev), + cfg->clockevent_rating); + if (ret < 0) + goto err3; + + return 0; + err3: + clk_unprepare(p->clk); + err2: + clk_put(p->clk); err1: iounmap(p->mapbase); err0: diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index 78b8dae49628..63557cda0a7d 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c @@ -472,12 +472,26 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) ret = PTR_ERR(p->clk); goto err1; } + + ret = clk_prepare(p->clk); + if (ret < 0) + goto err2; + p->cs_enabled = false; p->enable_count = 0; - return sh_tmu_register(p, (char *)dev_name(&p->pdev->dev), - cfg->clockevent_rating, - cfg->clocksource_rating); + ret = sh_tmu_register(p, (char *)dev_name(&p->pdev->dev), + cfg->clockevent_rating, + cfg->clocksource_rating); + if (ret < 0) + goto err3; + + return 0; + + err3: + clk_unprepare(p->clk); + err2: + clk_put(p->clk); err1: iounmap(p->mapbase); err0: |