diff options
| author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2013-10-01 05:00:53 -0400 |
|---|---|---|
| committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-10-02 05:42:48 -0400 |
| commit | 326e31eebe61dc838e031ea16968b2cfb43443e3 (patch) | |
| tree | a4e11e9c3f9b2e2b8463750d1a767a1f0ba94971 /drivers/clocksource | |
| parent | fa94bd57b5a5b2206e5fdd0ed2dbacff199121f2 (diff) | |
clocksource: Put nodes passed to CLOCKSOURCE_OF_DECLARE callbacks centrally
Instead of letting each driver call of_node_put do it centrally in the
loop that also calls the CLOCKSOURCE_OF_DECLARE callbacks. This is less
prone to error and also moves getting and putting the references into the
same function.
Consequently all respective of_node_put calls in drivers are removed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: David Brown <davidb@codeaurora.org>
Diffstat (limited to 'drivers/clocksource')
| -rw-r--r-- | drivers/clocksource/clksrc-of.c | 1 | ||||
| -rw-r--r-- | drivers/clocksource/dw_apb_timer_of.c | 2 | ||||
| -rw-r--r-- | drivers/clocksource/tegra20_timer.c | 4 | ||||
| -rw-r--r-- | drivers/clocksource/vt8500_timer.c | 2 |
4 files changed, 1 insertions, 8 deletions
diff --git a/drivers/clocksource/clksrc-of.c b/drivers/clocksource/clksrc-of.c index 37f5325bec95..8b2ed14f121d 100644 --- a/drivers/clocksource/clksrc-of.c +++ b/drivers/clocksource/clksrc-of.c | |||
| @@ -32,5 +32,6 @@ void __init clocksource_of_init(void) | |||
| 32 | for_each_matching_node_and_match(np, __clksrc_of_table, &match) { | 32 | for_each_matching_node_and_match(np, __clksrc_of_table, &match) { |
| 33 | init_func = match->data; | 33 | init_func = match->data; |
| 34 | init_func(np); | 34 | init_func(np); |
| 35 | of_node_put(np); | ||
| 35 | } | 36 | } |
| 36 | } | 37 | } |
diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c index 003b2309f463..482618b59fa4 100644 --- a/drivers/clocksource/dw_apb_timer_of.c +++ b/drivers/clocksource/dw_apb_timer_of.c | |||
| @@ -138,12 +138,10 @@ static void __init dw_apb_timer_init(struct device_node *timer) | |||
| 138 | case 0: | 138 | case 0: |
| 139 | pr_debug("%s: found clockevent timer\n", __func__); | 139 | pr_debug("%s: found clockevent timer\n", __func__); |
| 140 | add_clockevent(timer); | 140 | add_clockevent(timer); |
| 141 | of_node_put(timer); | ||
| 142 | break; | 141 | break; |
| 143 | case 1: | 142 | case 1: |
| 144 | pr_debug("%s: found clocksource timer\n", __func__); | 143 | pr_debug("%s: found clocksource timer\n", __func__); |
| 145 | add_clocksource(timer); | 144 | add_clocksource(timer); |
| 146 | of_node_put(timer); | ||
| 147 | init_sched_clock(); | 145 | init_sched_clock(); |
| 148 | break; | 146 | break; |
| 149 | default: | 147 | default: |
diff --git a/drivers/clocksource/tegra20_timer.c b/drivers/clocksource/tegra20_timer.c index 5cff61677b6c..642849256d82 100644 --- a/drivers/clocksource/tegra20_timer.c +++ b/drivers/clocksource/tegra20_timer.c | |||
| @@ -181,8 +181,6 @@ static void __init tegra20_init_timer(struct device_node *np) | |||
| 181 | rate = clk_get_rate(clk); | 181 | rate = clk_get_rate(clk); |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | of_node_put(np); | ||
| 185 | |||
| 186 | switch (rate) { | 184 | switch (rate) { |
| 187 | case 12000000: | 185 | case 12000000: |
| 188 | timer_writel(0x000b, TIMERUS_USEC_CFG); | 186 | timer_writel(0x000b, TIMERUS_USEC_CFG); |
| @@ -241,8 +239,6 @@ static void __init tegra20_init_rtc(struct device_node *np) | |||
| 241 | else | 239 | else |
| 242 | clk_prepare_enable(clk); | 240 | clk_prepare_enable(clk); |
| 243 | 241 | ||
| 244 | of_node_put(np); | ||
| 245 | |||
| 246 | register_persistent_clock(NULL, tegra_read_persistent_clock); | 242 | register_persistent_clock(NULL, tegra_read_persistent_clock); |
| 247 | } | 243 | } |
| 248 | CLOCKSOURCE_OF_DECLARE(tegra20_rtc, "nvidia,tegra20-rtc", tegra20_init_rtc); | 244 | CLOCKSOURCE_OF_DECLARE(tegra20_rtc, "nvidia,tegra20-rtc", tegra20_init_rtc); |
diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c index 64f553f04fa4..ad3c0e83a779 100644 --- a/drivers/clocksource/vt8500_timer.c +++ b/drivers/clocksource/vt8500_timer.c | |||
| @@ -137,14 +137,12 @@ static void __init vt8500_timer_init(struct device_node *np) | |||
| 137 | if (!regbase) { | 137 | if (!regbase) { |
| 138 | pr_err("%s: Missing iobase description in Device Tree\n", | 138 | pr_err("%s: Missing iobase description in Device Tree\n", |
| 139 | __func__); | 139 | __func__); |
| 140 | of_node_put(np); | ||
| 141 | return; | 140 | return; |
| 142 | } | 141 | } |
| 143 | timer_irq = irq_of_parse_and_map(np, 0); | 142 | timer_irq = irq_of_parse_and_map(np, 0); |
| 144 | if (!timer_irq) { | 143 | if (!timer_irq) { |
| 145 | pr_err("%s: Missing irq description in Device Tree\n", | 144 | pr_err("%s: Missing irq description in Device Tree\n", |
| 146 | __func__); | 145 | __func__); |
| 147 | of_node_put(np); | ||
| 148 | return; | 146 | return; |
| 149 | } | 147 | } |
| 150 | 148 | ||
