{
struct resource *res;
struct platform_device *pdev;
- struct device_node *np = NULL;
struct mfd_of_node_entry *of_entry, *tmp;
bool disabled = false;
int ret = -ENOMEM;
goto fail_res;
if (IS_ENABLED(CONFIG_OF) && parent->of_node && cell->of_compatible) {
- for_each_child_of_node(parent->of_node, np) {
+ for_each_child_of_node_scoped(parent->of_node, np) {
if (of_device_is_compatible(np, cell->of_compatible)) {
/* Skip 'disabled' devices */
if (!of_device_is_available(np)) {
ret = mfd_match_of_node_to_dev(pdev, np, cell);
if (ret == -EAGAIN)
continue;
- of_node_put(np);
if (ret)
goto fail_alias;