aboutsummaryrefslogtreecommitdiff
path: root/drivers/clocksource/timer-cadence-ttc.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-12-04 00:39:45 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-12-04 00:39:45 +0100
commitfef92cd2bc04c64bb3743d40c0b4be47aedf9e23 (patch)
tree2a67e73223d40cd16f4b799830b0d13f711ad8b0 /drivers/clocksource/timer-cadence-ttc.c
parentb996544916429946bf4934c1c01a306d1690972c (diff)
parentab3105446f1ec4e98fadfc998ee24feec271c16c (diff)
Merge tag 'timers-v5.11' of https://git.linaro.org/people/daniel.lezcano/linux into timers/core
Pull clocksource/event driver updates from Daniel Lezcano: - Add static annotation for the sp804 init functions (Zhen Lei) - Code cleanups and error code path at init time fixes on the sp804 (Kefen Wang) - Add new OST timer driver device tree bindings (Zhou Yanjie) - Remove EZChip NPS clocksource driver corresponding to the NPS platform which was removed from the ARC architecture (Vineet Gupta) - Add missing clk_disable_unprepare() on error path for Orion (Yang Yingliang) - Add device tree bindings documentation for Renesas r8a774e1 (Marian-Cristian Rotariu) - Convert Renesas TMU to json-schema (Geert Uytterhoeven) - Fix memory leak on the error path at init time on the cadence_ttc driver (Yu Kuai) - Fix section mismatch for Ingenic timer driver (Daniel Lezcano) - Make RISCV_TIMER depends on RISCV_SBI (Kefeng Wang) Link: https://lore.kernel.org/r/028084fa-d29b-a1d5-7eab-17f77ef69863@linaro.org
Diffstat (limited to 'drivers/clocksource/timer-cadence-ttc.c')
-rw-r--r--drivers/clocksource/timer-cadence-ttc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c
index 80e960602030..4efd0cf3b602 100644
--- a/drivers/clocksource/timer-cadence-ttc.c
+++ b/drivers/clocksource/timer-cadence-ttc.c
@@ -413,10 +413,8 @@ static int __init ttc_setup_clockevent(struct clk *clk,
ttcce->ttc.clk = clk;
err = clk_prepare_enable(ttcce->ttc.clk);
- if (err) {
- kfree(ttcce);
- return err;
- }
+ if (err)
+ goto out_kfree;
ttcce->ttc.clk_rate_change_nb.notifier_call =
ttc_rate_change_clockevent_cb;
@@ -426,7 +424,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
&ttcce->ttc.clk_rate_change_nb);
if (err) {
pr_warn("Unable to register clock notifier.\n");
- return err;
+ goto out_kfree;
}
ttcce->ttc.freq = clk_get_rate(ttcce->ttc.clk);
@@ -455,15 +453,17 @@ static int __init ttc_setup_clockevent(struct clk *clk,
err = request_irq(irq, ttc_clock_event_interrupt,
IRQF_TIMER, ttcce->ce.name, ttcce);
- if (err) {
- kfree(ttcce);
- return err;
- }
+ if (err)
+ goto out_kfree;
clockevents_config_and_register(&ttcce->ce,
ttcce->ttc.freq / PRESCALE, 1, 0xfffe);
return 0;
+
+out_kfree:
+ kfree(ttcce);
+ return err;
}
static int __init ttc_timer_probe(struct platform_device *pdev)