提交 4f41fe38 编写于 作者: S Saravana Kannan 提交者: Daniel Lezcano

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: NSaravana Kannan <saravanak@google.com>
Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200111052125.238212-1-saravanak@google.com
上级 3d17cee2
...@@ -27,8 +27,10 @@ void __init timer_probe(void) ...@@ -27,8 +27,10 @@ void __init timer_probe(void)
init_func_ret = match->data; init_func_ret = match->data;
of_node_set_flag(np, OF_POPULATED);
ret = init_func_ret(np); ret = init_func_ret(np);
if (ret) { if (ret) {
of_node_clear_flag(np, OF_POPULATED);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
pr_err("Failed to initialize '%pOF': %d\n", np, pr_err("Failed to initialize '%pOF': %d\n", np,
ret); ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册