When returning a resource that we've allocated with rman_reserve_resource,
go ahead and set the rid for that resource.
This commit is contained in:
parent
99b0e15695
commit
018dc558f6
@ -214,6 +214,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
if (rv == 0)
|
||||
return 0;
|
||||
|
||||
rman_set_rid(rv, *rid);
|
||||
rman_set_bustag(rv, (void*)ARM_BUS_SPACE_MEM);
|
||||
rman_set_bushandle(rv, rman_get_start(rv));
|
||||
|
||||
|
@ -497,6 +497,7 @@ at91_alloc_resource(device_t dev, device_t child, int type, int *rid,
|
||||
rle->start = rman_get_start(rle->res);
|
||||
rle->end = rman_get_end(rle->res);
|
||||
rle->count = count;
|
||||
rman_set_rid(rle->res, *rid);
|
||||
}
|
||||
return (rle->res);
|
||||
}
|
||||
|
@ -127,6 +127,8 @@ sa1110_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
|
||||
res = rman_reserve_resource(&sa11x0_softc->sa11x0_rman, *rid, *rid,
|
||||
count, flags, child);
|
||||
if (res != NULL)
|
||||
rman_set_rid(res, *rid);
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
@ -380,6 +380,7 @@ i80321_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
rv = rman_reserve_resource(rm, start, end, count, flags, child);
|
||||
if (rv == NULL)
|
||||
return (NULL);
|
||||
rman_set_rid(rv, *rid);
|
||||
if (type != SYS_RES_IRQ) {
|
||||
if (type == SYS_RES_MEMORY)
|
||||
bh += (rman_get_start(rv));
|
||||
|
@ -300,10 +300,14 @@ iq80321_alloc_resource(device_t dev, device_t child, int type, int *rid,
|
||||
u_long start, u_long end, u_long count, u_int flags)
|
||||
{
|
||||
struct i80321_softc *sc = device_get_softc(dev);
|
||||
|
||||
if (type == SYS_RES_IRQ)
|
||||
return (rman_reserve_resource(&sc->sc_irq_rman,
|
||||
start, end, count, flags, child));
|
||||
struct resource *rv;
|
||||
|
||||
if (type == SYS_RES_IRQ) {
|
||||
rv = rman_reserve_resource(&sc->sc_irq_rman,
|
||||
start, end, count, flags, child);
|
||||
if (rv != NULL)
|
||||
rman_set_rid(rv, *rid);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
@ -124,6 +124,7 @@ obio_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
||||
return (NULL);
|
||||
if (type == SYS_RES_IRQ)
|
||||
return (rv);
|
||||
rman_set_rid(rv, *rid);
|
||||
rman_set_bustag(rv, bt);
|
||||
rman_set_bushandle(rv, bh);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user