svn commit: r286653 - head/sys/dev/uart
Marcel Moolenaar
marcel at FreeBSD.org
Wed Aug 12 04:03:05 UTC 2015
Author: marcel
Date: Wed Aug 12 04:03:04 2015
New Revision: 286653
URL: https://svnweb.freebsd.org/changeset/base/286653
Log:
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.
Modified:
head/sys/dev/uart/uart_core.c
Modified: head/sys/dev/uart/uart_core.c
==============================================================================
--- head/sys/dev/uart/uart_core.c Wed Aug 12 03:03:51 2015 (r286652)
+++ head/sys/dev/uart/uart_core.c Wed Aug 12 04:03:04 2015 (r286653)
@@ -474,14 +474,13 @@ uart_bus_probe(device_t dev, int regshft
*/
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);
More information about the svn-src-all
mailing list