Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ofw/ofwbus.c
| Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | if (!passthrough && rle != NULL) { | ||||
| rle->end = rman_get_end(rv); | rle->end = rman_get_end(rv); | ||||
| rle->count = rle->end - rle->start + 1; | rle->count = rle->end - rle->start + 1; | ||||
| } | } | ||||
| return (rv); | return (rv); | ||||
| } | } | ||||
| static int | static int | ||||
| ofwbus_release_resource(device_t bus, device_t child, int type, | ofwbus_release_resource(device_t bus, device_t child, struct resource *r) | ||||
| int rid, struct resource *r) | |||||
| { | { | ||||
| struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
| bool passthrough; | bool passthrough; | ||||
| passthrough = (device_get_parent(child) != bus); | passthrough = (device_get_parent(child) != bus); | ||||
| if (!passthrough) { | if (!passthrough) { | ||||
| /* Clean resource list entry */ | /* Clean resource list entry */ | ||||
| rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), | rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), | ||||
| type, rid); | rman_get_type(r), rman_get_rid(r)); | ||||
| if (rle != NULL) | if (rle != NULL) | ||||
| rle->res = NULL; | rle->res = NULL; | ||||
| } | } | ||||
| /* Let nexus handle the release. */ | /* Let nexus handle the release. */ | ||||
| return (bus_generic_release_resource(bus, child, type, rid, r)); | return (bus_generic_release_resource(bus, child, r)); | ||||
| } | } | ||||