MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bus_alloc_resources

Function bus_alloc_resources

freebsd/kern/subr_bus.c:4570–4587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4568 */
4569
4570int
4571bus_alloc_resources(device_t dev, struct resource_spec *rs,
4572 struct resource **res)
4573{
4574 int i;
4575
4576 for (i = 0; rs[i].type != -1; i++)
4577 res[i] = NULL;
4578 for (i = 0; rs[i].type != -1; i++) {
4579 res[i] = bus_alloc_resource_any(dev,
4580 rs[i].type, &rs[i].rid, rs[i].flags);
4581 if (res[i] == NULL && !(rs[i].flags & RF_OPTIONAL)) {
4582 bus_release_resources(dev, rs, res);
4583 return (ENXIO);
4584 }
4585 }
4586 return (0);
4587}
4588
4589void
4590bus_release_resources(device_t dev, const struct resource_spec *rs,

Callers 15

jz4780_nemc_attachFunction · 0.85
jz4780_mmc_attachFunction · 0.85
aic_attachFunction · 0.85
jz4780_pic_attachFunction · 0.85
jz4780_gpio_attachFunction · 0.85
jz4780_clock_attachFunction · 0.85
jzlcd_attachFunction · 0.85
pdma_attachFunction · 0.85
codec_attachFunction · 0.85
jz4780_rtc_attachFunction · 0.85
jz4780_timer_attachFunction · 0.85
jz4780_dme_attachFunction · 0.85

Calls 2

bus_alloc_resource_anyFunction · 0.85
bus_release_resourcesFunction · 0.85

Tested by

no test coverage detected