summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_core.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2015-08-12 04:03:04 +0000
committermarcel <marcel@FreeBSD.org>2015-08-12 04:03:04 +0000
commit2cbd9cb8cc40b235ee56228ef13acedb98ec812e (patch)
treeefc8bc1bbd18beadd77e65015a5a227c54491eb2 /sys/dev/uart/uart_core.c
parente4c5c97bc89b50a0ae401a79fcc05917ea723c35 (diff)
downloadFreeBSD-src-2cbd9cb8cc40b235ee56228ef13acedb98ec812e.zip
FreeBSD-src-2cbd9cb8cc40b235ee56228ef13acedb98ec812e.tar.gz
Use bus_alloc_resource_any(), rather than bus_alloc_resource()
with start 0 and end ~0. This avoids confusion WRT to what the value of length can or should be.
Diffstat (limited to 'sys/dev/uart/uart_core.c')
-rw-r--r--sys/dev/uart/uart_core.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c
index 20b617b..96b4529 100644
--- a/sys/dev/uart/uart_core.c
+++ b/sys/dev/uart/uart_core.c
@@ -474,14 +474,13 @@ uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan)
*/
sc->sc_rrid = rid;
sc->sc_rtype = SYS_RES_IOPORT;
- sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid,
- 0, ~0, uart_getrange(sc->sc_class), RF_ACTIVE);
+ sc->sc_rres = bus_alloc_resource_any(dev, sc->sc_rtype, &sc->sc_rrid,
+ RF_ACTIVE);
if (sc->sc_rres == NULL) {
sc->sc_rrid = rid;
sc->sc_rtype = SYS_RES_MEMORY;
- sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype,
- &sc->sc_rrid, 0, ~0, uart_getrange(sc->sc_class),
- RF_ACTIVE);
+ sc->sc_rres = bus_alloc_resource_any(dev, sc->sc_rtype,
+ &sc->sc_rrid, RF_ACTIVE);
if (sc->sc_rres == NULL)
return (ENXIO);
}
@@ -556,8 +555,8 @@ uart_bus_attach(device_t dev)
* Re-allocate. We expect that the softc contains the information
* collected by uart_bus_probe() intact.
*/
- sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid,
- 0, ~0, uart_getrange(sc->sc_class), RF_ACTIVE);
+ sc->sc_rres = bus_alloc_resource_any(dev, sc->sc_rtype, &sc->sc_rrid,
+ RF_ACTIVE);
if (sc->sc_rres == NULL) {
mtx_destroy(&sc->sc_hwmtx_s);
return (ENXIO);
OpenPOWER on IntegriCloud