lkml.org 
[lkml]   [2020]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip: timers/core] clocksource/drivers/timer-probe: Avoid creating dead devices
The following commit has been merged into the timers/core branch of tip:

Commit-ID: 4f41fe386a94639cd9a1831298d4f85db5662f1e
Gitweb: https://git.kernel.org/tip/4f41fe386a94639cd9a1831298d4f85db5662f1e
Author: Saravana Kannan <saravanak@google.com>
AuthorDate: Fri, 10 Jan 2020 21:21:25 -08:00
Committer: Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Tue, 17 Mar 2020 13:10:07 +01:00

clocksource/drivers/timer-probe: Avoid creating dead devices

Timer initialization is done during early boot way before the driver
core starts processing devices and drivers. Timers initialized during
this early boot period don't really need or use a struct device.

However, for timers represented as device tree nodes, the struct devices
are still created and sit around unused and wasting memory. This change
avoid this by marking the device tree nodes as "populated" if the
corresponding timer is successfully initialized.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200111052125.238212-1-saravanak@google.com
---
drivers/clocksource/timer-probe.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/timer-probe.c b/drivers/clocksource/timer-probe.c
index ee9574d..a10f28d 100644
--- a/drivers/clocksource/timer-probe.c
+++ b/drivers/clocksource/timer-probe.c
@@ -27,8 +27,10 @@ void __init timer_probe(void)

init_func_ret = match->data;

+ of_node_set_flag(np, OF_POPULATED);
ret = init_func_ret(np);
if (ret) {
+ of_node_clear_flag(np, OF_POPULATED);
if (ret != -EPROBE_DEFER)
pr_err("Failed to initialize '%pOF': %d\n", np,
ret);
\
 
 \ /
  Last update: 2020-03-19 09:49    [W:0.211 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site