mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
simplebus: Map SYS_RES_IOPORT to SYS_RES_MEMORY later in alloc_resource
Specifically, the set/get_resource methods do not currently remap resource types, so remap the type in alloc_resource only after looking for a matching resource list entry. Fixes: 3cf553288b96 simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY (cherry picked from commit 4505c89242025f840023cdf092fdab845586f42d)
This commit is contained in:
parent
555691ca60
commit
8765268c11
1 changed files with 3 additions and 3 deletions
|
|
@ -448,9 +448,6 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
|||
|
||||
sc = device_get_softc(bus);
|
||||
|
||||
if (type == SYS_RES_IOPORT)
|
||||
type = SYS_RES_MEMORY;
|
||||
|
||||
/*
|
||||
* Request for the default allocation with a given rid: use resource
|
||||
* list stored in the local device info.
|
||||
|
|
@ -471,6 +468,9 @@ simplebus_alloc_resource(device_t bus, device_t child, int type, int *rid,
|
|||
count = rle->count;
|
||||
}
|
||||
|
||||
if (type == SYS_RES_IOPORT)
|
||||
type = SYS_RES_MEMORY;
|
||||
|
||||
if (type == SYS_RES_MEMORY) {
|
||||
/* Remap through ranges property */
|
||||
for (j = 0; j < sc->nranges; j++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue