struct pm860x_backlight_data *data,
char *name)
{
- struct device_node *nproot, *np;
+ struct device_node *nproot;
int iset = 0;
nproot = of_get_child_by_name(pdev->dev.parent->of_node, "backlights");
dev_err(&pdev->dev, "failed to find backlights node\n");
return -ENODEV;
}
- for_each_child_of_node(nproot, np) {
+ for_each_child_of_node_scoped(nproot, np) {
if (of_node_name_eq(np, name)) {
of_property_read_u32(np, "marvell,88pm860x-iset",
&iset);
data->iset = PM8606_WLED_CURRENT(iset);
of_property_read_u32(np, "marvell,88pm860x-pwm",
&data->pwm);
- of_node_put(np);
break;
}
}