Put nodes after of_address_to_resource() in case the nodes might be
released while parsing in them.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
int ret;
np = of_find_compatible_node(NULL, NULL, "socionext,uniphier-smpctrl");
int ret;
np = of_find_compatible_node(NULL, NULL, "socionext,uniphier-smpctrl");
ret = of_address_to_resource(np, 0, &res);
ret = of_address_to_resource(np, 0, &res);
if (!ret) {
rom_rsv2_phys = res.start + UNIPHIER_SMPCTRL_ROM_RSV2;
} else {
/* try old binding too */
np = of_find_compatible_node(NULL, NULL,
"socionext,uniphier-system-bus-controller");
if (!ret) {
rom_rsv2_phys = res.start + UNIPHIER_SMPCTRL_ROM_RSV2;
} else {
/* try old binding too */
np = of_find_compatible_node(NULL, NULL,
"socionext,uniphier-system-bus-controller");
ret = of_address_to_resource(np, 1, &res);
ret = of_address_to_resource(np, 1, &res);
if (ret) {
pr_err("failed to get resource of SMP control\n");
return ret;
if (ret) {
pr_err("failed to get resource of SMP control\n");
return ret;