[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9f3afa0-f0a7-6cff-2e57-e4e448a81a90@linaro.org>
Date: Thu, 27 Feb 2020 10:06:37 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Saravana Kannan <saravanak@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>
Cc: kernel-team@...roid.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] clocksource: Avoid creating dead devices
On 11/01/2020 06:21, Saravana Kannan wrote:
> 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@...gle.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 ee9574da53c0..a10f28d750a9 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);
Isn't it in conflict with:
drivers/clocksource/ingenic-timer.c
?
> if (ret != -EPROBE_DEFER)
> pr_err("Failed to initialize '%pOF': %d\n", np,
> ret);
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Powered by blists - more mailing lists