struct device_node *regions __free(device_node) =
of_get_child_by_name(node, "descriptor-regions");
struct knav_region *region;
- struct device_node *child;
u32 temp[2];
int ret;
return dev_err_probe(dev, -ENODEV,
"descriptor-regions not specified\n");
- for_each_child_of_node(regions, child) {
+ for_each_child_of_node_scoped(regions, child) {
region = devm_kzalloc(dev, sizeof(*region), GFP_KERNEL);
- if (!region) {
- of_node_put(child);
+ if (!region)
return -ENOMEM;
- }
region->name = knav_queue_find_name(child);
of_property_read_u32(child, "id", ®ion->id);
struct device_node *qmgrs __free(device_node) =
of_get_child_by_name(node, "qmgrs");
struct knav_qmgr_info *qmgr;
- struct device_node *child;
u32 temp[2];
int ret;
return dev_err_probe(dev, -ENODEV,
"queue manager info not specified\n");
- for_each_child_of_node(qmgrs, child) {
+ for_each_child_of_node_scoped(qmgrs, child) {
qmgr = devm_kzalloc(dev, sizeof(*qmgr), GFP_KERNEL);
- if (!qmgr) {
- of_node_put(child);
+ if (!qmgr)
return -ENOMEM;
- }
ret = of_property_read_u32_array(child, "managed-queues",
temp, 2);
{
struct device *dev = kdev->dev;
struct knav_pdsp_info *pdsp;
- struct device_node *child;
- for_each_child_of_node(pdsps, child) {
+ for_each_child_of_node_scoped(pdsps, child) {
pdsp = devm_kzalloc(dev, sizeof(*pdsp), GFP_KERNEL);
- if (!pdsp) {
- of_node_put(child);
+ if (!pdsp)
return -ENOMEM;
- }
+
pdsp->name = knav_queue_find_name(child);
pdsp->iram =
knav_queue_map_reg(kdev, child,