git: 6343760d7405 - stable/14 - bhnd: Use rman_get_type in bhndb_find_resource_limits
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 27 Feb 2025 14:17:21 UTC
The branch stable/14 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=6343760d74050b27eb84dc7c3712837361661a1d
commit 6343760d74050b27eb84dc7c3712837361661a1d
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-03-13 22:05:53 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-02-27 13:09:23 +0000
bhnd: Use rman_get_type in bhndb_find_resource_limits
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44126
(cherry picked from commit 3351964c5e5d29ef93b3f26b7fc31a4972aa9af7)
---
sys/dev/bhnd/bhndb/bhndb.c | 2 +-
sys/dev/bhnd/bhndb/bhndb_private.h | 2 +-
sys/dev/bhnd/bhndb/bhndb_subr.c | 8 ++++----
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c
index 978ad9c3e62b..ea5230bf459b 100644
--- a/sys/dev/bhnd/bhndb/bhndb.c
+++ b/sys/dev/bhnd/bhndb/bhndb.c
@@ -1113,7 +1113,7 @@ bhndb_adjust_resource(device_t dev, device_t child, int type,
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
index 851cbe82d3a7..7b56f0b05c84 100644
--- a/sys/dev/bhnd/bhndb/bhndb_private.h
+++ b/sys/dev/bhnd/bhndb/bhndb_private.h
@@ -73,7 +73,7 @@ int bhndb_add_resource_region(
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
index 94d415d67064..b695785a4f7a 100644
--- a/sys/dev/bhnd/bhndb/bhndb_subr.c
+++ b/sys/dev/bhnd/bhndb/bhndb_subr.c
@@ -988,7 +988,6 @@ bhndb_find_intr_handler(struct bhndb_resources *br, void *cookiep)
* 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.
@@ -997,14 +996,14 @@ bhndb_find_intr_handler(struct bhndb_resources *br, void *cookiep)
* @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) {
@@ -1043,7 +1042,8 @@ bhndb_find_resource_limits(struct bhndb_resources *br, int type,
}
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);
}
}