]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bus: ti-sysc: Fix initializing module_pa for modules without sysc register
authorTony Lindgren <tony@atomide.com>
Mon, 8 Mar 2021 09:35:06 +0000 (11:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:49:35 +0000 (10:49 +0200)
[ Upstream commit 7bad5af826aba00487fed9a3300d3f43f0cba11b ]

We have interconnect target modules with no known registers using only
clocks and resets, but we still want to detect them based on the module
IO range. So let's call sysc_parse_and_check_child_range() earlier so we
have module_pa properly initialized.

Fixes: 2928135c93f8 ("bus: ti-sysc: Support modules without control registers")
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bus/ti-sysc.c

index 9e535336689fdc939dd0295c93ae1aa66e20b6de..68145e326eb90cff47e7a3f8be11756027819164 100644 (file)
@@ -901,9 +901,6 @@ static int sysc_map_and_check_registers(struct sysc *ddata)
        struct device_node *np = ddata->dev->of_node;
        int error;
 
-       if (!of_get_property(np, "reg", NULL))
-               return 0;
-
        error = sysc_parse_and_check_child_range(ddata);
        if (error)
                return error;
@@ -914,6 +911,9 @@ static int sysc_map_and_check_registers(struct sysc *ddata)
 
        sysc_check_children(ddata);
 
+       if (!of_get_property(np, "reg", NULL))
+               return 0;
+
        error = sysc_parse_registers(ddata);
        if (error)
                return error;