diff --git a/sys/dev/fdt/simplebus.c b/sys/dev/fdt/simplebus.c index bf6fceb48a9..71ba8a0a1f7 100644 --- a/sys/dev/fdt/simplebus.c +++ b/sys/dev/fdt/simplebus.c @@ -447,9 +447,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. @@ -470,6 +467,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++) {