Skip to content

Commit 4f41fe3

Browse files
Saravana Kannandlezcano
authored andcommitted
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
1 parent 3d17cee commit 4f41fe3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/clocksource/timer-probe.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ void __init timer_probe(void)
2727

2828
init_func_ret = match->data;
2929

30+
of_node_set_flag(np, OF_POPULATED);
3031
ret = init_func_ret(np);
3132
if (ret) {
33+
of_node_clear_flag(np, OF_POPULATED);
3234
if (ret != -EPROBE_DEFER)
3335
pr_err("Failed to initialize '%pOF': %d\n", np,
3436
ret);

0 commit comments

Comments
 (0)