Even if we don't have a /chosen node, a barebox,environment node may be added later or it may not be under /chosen at all with the incoming new binding. Therefore register the driver unconditionally if we are on an OF system. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- drivers/of/barebox.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/of/barebox.c b/drivers/of/barebox.c index ed5d171e43a8..65392697913b 100644 --- a/drivers/of/barebox.c +++ b/drivers/of/barebox.c @@ -108,13 +108,9 @@ static int barebox_of_driver_init(void) return 0; node = of_find_node_by_path("/chosen"); - if (!node) - return 0; + if (node) + of_platform_populate(node, of_default_bus_match_table, NULL); - of_platform_populate(node, of_default_bus_match_table, NULL); - - platform_driver_register(&environment_driver); - - return 0; + return platform_driver_register(&environment_driver); } late_initcall(barebox_of_driver_init); -- 2.39.5