Date: Wed, 12 Aug 2015 04:03:04 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286653 - head/sys/dev/uart Message-ID: <201508120403.t7C434Wq012464@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508120403.t7C434Wq012464>