diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c --- a/sys/dev/bhnd/bhndb/bhndb.c +++ b/sys/dev/bhnd/bhndb/bhndb.c @@ -1113,7 +1113,7 @@ goto done; /* Otherwise, the range is limited by the bridged resource mapping */ - error = bhndb_find_resource_limits(sc->bus_res, type, r, &mstart, + error = bhndb_find_resource_limits(sc->bus_res, r, &mstart, &mend); if (error) goto done; diff --git a/sys/dev/bhnd/bhndb/bhndb_private.h b/sys/dev/bhnd/bhndb/bhndb_private.h --- a/sys/dev/bhnd/bhndb/bhndb_private.h +++ b/sys/dev/bhnd/bhndb/bhndb_private.h @@ -73,7 +73,7 @@ const struct bhndb_regwin *static_regwin); int bhndb_find_resource_limits( - struct bhndb_resources *br, int type, + struct bhndb_resources *br, struct resource *r, rman_res_t *start, rman_res_t *end); diff --git a/sys/dev/bhnd/bhndb/bhndb_subr.c b/sys/dev/bhnd/bhndb/bhndb_subr.c --- a/sys/dev/bhnd/bhndb/bhndb_subr.c +++ b/sys/dev/bhnd/bhndb/bhndb_subr.c @@ -987,7 +987,6 @@ * returned. * * @param br The resource state to search. - * @param type The resource type (see SYS_RES_*). * @param r The resource to search for in @p br. * @param[out] start On success, the minimum supported start address. * @param[out] end On success, the maximum supported end address. @@ -996,14 +995,14 @@ * @retval ENOENT no active mapping found for @p r of @p type */ int -bhndb_find_resource_limits(struct bhndb_resources *br, int type, +bhndb_find_resource_limits(struct bhndb_resources *br, struct resource *r, rman_res_t *start, rman_res_t *end) { struct bhndb_dw_alloc *dynamic; struct bhndb_region *sregion; struct bhndb_intr_handler *ih; - switch (type) { + switch (rman_get_type(r)) { case SYS_RES_IRQ: /* Is this one of ours? */ STAILQ_FOREACH(ih, &br->bus_intrs, ih_link) { @@ -1042,7 +1041,8 @@ } default: - device_printf(br->dev, "unknown resource type: %d\n", type); + device_printf(br->dev, "unknown resource type: %d\n", + rman_get_type(r)); return (ENOENT); } }