| 433 | } |
| 434 | |
| 435 | static int |
| 436 | nexus_activate_resource(device_t bus, device_t child, int type, int rid, |
| 437 | struct resource *r) |
| 438 | { |
| 439 | struct resource_map map; |
| 440 | int error; |
| 441 | |
| 442 | error = rman_activate_resource(r); |
| 443 | if (error != 0) |
| 444 | return (error); |
| 445 | |
| 446 | if (!(rman_get_flags(r) & RF_UNMAPPED) && |
| 447 | (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT)) { |
| 448 | error = nexus_map_resource(bus, child, type, r, NULL, &map); |
| 449 | if (error) { |
| 450 | rman_deactivate_resource(r); |
| 451 | return (error); |
| 452 | } |
| 453 | |
| 454 | rman_set_mapping(r,&map); |
| 455 | } |
| 456 | return (0); |
| 457 | } |
| 458 | |
| 459 | static int |
| 460 | nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, |
nothing calls this directly
no test coverage detected