git: 07b5d67777a7 - stable/14 - acpi: Use rman_get_type in acpi_is_resource_managed
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 27 Feb 2025 14:17:20 UTC
The branch stable/14 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=07b5d67777a73867dddc2be850c367f209a12f37
commit 07b5d67777a73867dddc2be850c367f209a12f37
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
acpi: Use rman_get_type in acpi_is_resource_managed
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44125
(cherry picked from commit 0ecee1602e195933a39da65d34440399129e19fb)
---
sys/dev/acpica/acpi.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index ee2494debae7..de6520331644 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -1554,11 +1554,11 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid,
}
static bool
-acpi_is_resource_managed(device_t bus, int type, struct resource *r)
+acpi_is_resource_managed(device_t bus, struct resource *r)
{
struct rman *rm;
- rm = acpi_get_rman(bus, type, 0);
+ rm = acpi_get_rman(bus, rman_get_type(r), rman_get_flags(r));
if (rm == NULL)
return (false);
return (rman_is_region_manager(r, rm));
@@ -1570,7 +1570,7 @@ acpi_managed_resource(device_t bus, int type, struct resource *r)
struct acpi_softc *sc = device_get_softc(bus);
struct resource_list_entry *rle;
- KASSERT(acpi_is_resource_managed(bus, type, r),
+ KASSERT(acpi_is_resource_managed(bus, r),
("resource %p is not suballocated", r));
STAILQ_FOREACH(rle, &sc->sysres_rl, link) {
@@ -1588,7 +1588,7 @@ acpi_adjust_resource(device_t bus, device_t child, int type, struct resource *r,
rman_res_t start, rman_res_t end)
{
- if (acpi_is_resource_managed(bus, type, r))
+ if (acpi_is_resource_managed(bus, r))
return (rman_adjust_resource(r, start, end));
return (bus_generic_adjust_resource(bus, child, type, r, start, end));
}
@@ -1601,7 +1601,7 @@ acpi_release_resource(device_t bus, device_t child, int type, int rid,
* If this resource belongs to one of our internal managers,
* deactivate it and release it to the local pool.
*/
- if (acpi_is_resource_managed(bus, type, r))
+ if (acpi_is_resource_managed(bus, r))
return (bus_generic_rman_release_resource(bus, child, type, rid, r));
return (bus_generic_rl_release_resource(bus, child, type, rid, r));
@@ -1627,7 +1627,7 @@ static int
acpi_activate_resource(device_t bus, device_t child, int type, int rid,
struct resource *r)
{
- if (acpi_is_resource_managed(bus, type, r))
+ if (acpi_is_resource_managed(bus, r))
return (bus_generic_rman_activate_resource(bus, child, type,
rid, r));
return (bus_generic_activate_resource(bus, child, type, rid, r));
@@ -1637,7 +1637,7 @@ static int
acpi_deactivate_resource(device_t bus, device_t child, int type, int rid,
struct resource *r)
{
- if (acpi_is_resource_managed(bus, type, r))
+ if (acpi_is_resource_managed(bus, r))
return (bus_generic_rman_deactivate_resource(bus, child, type,
rid, r));
return (bus_generic_deactivate_resource(bus, child, type, rid, r));
@@ -1652,7 +1652,7 @@ acpi_map_resource(device_t bus, device_t child, int type, struct resource *r,
rman_res_t length, start;
int error;
- if (!acpi_is_resource_managed(bus, type, r))
+ if (!acpi_is_resource_managed(bus, r))
return (bus_generic_map_resource(bus, child, type, r, argsp,
map));
@@ -1678,7 +1678,7 @@ static int
acpi_unmap_resource(device_t bus, device_t child, int type, struct resource *r,
struct resource_map *map)
{
- if (acpi_is_resource_managed(bus, type, r)) {
+ if (acpi_is_resource_managed(bus, r)) {
r = acpi_managed_resource(bus, type, r);
if (r == NULL)
return (ENOENT);