Lines Matching refs:region
24 #define for_each_region(region, afu) \ argument
25 list_for_each_entry((region), &(afu)->regions, node)
30 struct dfl_afu_mmio_region *region; in get_region_by_index() local
32 for_each_region(region, afu) in get_region_by_index()
33 if (region->index == region_index) in get_region_by_index()
34 return region; in get_region_by_index()
53 struct dfl_afu_mmio_region *region; in afu_mmio_region_add() local
57 region = devm_kzalloc(&pdata->dev->dev, sizeof(*region), GFP_KERNEL); in afu_mmio_region_add()
58 if (!region) in afu_mmio_region_add()
61 region->index = region_index; in afu_mmio_region_add()
62 region->size = region_size; in afu_mmio_region_add()
63 region->phys = phys; in afu_mmio_region_add()
64 region->flags = flags; in afu_mmio_region_add()
78 region->offset = afu->region_cur_offset; in afu_mmio_region_add()
79 list_add(®ion->node, &afu->regions); in afu_mmio_region_add()
88 devm_kfree(&pdata->dev->dev, region); in afu_mmio_region_add()
99 struct dfl_afu_mmio_region *tmp, *region; in afu_mmio_region_destroy() local
101 list_for_each_entry_safe(region, tmp, &afu->regions, node) in afu_mmio_region_destroy()
102 devm_kfree(&pdata->dev->dev, region); in afu_mmio_region_destroy()
117 struct dfl_afu_mmio_region *region; in afu_mmio_region_get_by_index() local
123 region = get_region_by_index(afu, region_index); in afu_mmio_region_get_by_index()
124 if (!region) { in afu_mmio_region_get_by_index()
128 *pregion = *region; in afu_mmio_region_get_by_index()
151 struct dfl_afu_mmio_region *region; in afu_mmio_region_get_by_offset() local
157 for_each_region(region, afu) in afu_mmio_region_get_by_offset()
158 if (region->offset <= offset && in afu_mmio_region_get_by_offset()
159 region->offset + region->size >= offset + size) { in afu_mmio_region_get_by_offset()
160 *pregion = *region; in afu_mmio_region_get_by_offset()