aboutsummaryrefslogtreecommitdiff
path: root/sys/arm
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2024-03-13 22:05:54 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2024-03-13 22:05:54 +0000
commitd77f2092ceebaba115e6be53410428f6f5f6ae83 (patch)
tree7ef42f41d2c2ca7060e9261236ce5ab27adf3d1e /sys/arm
parentfef01f0498aa7b256bc37bbf28ee0e8ac9b2536f (diff)
downloadsrc-d77f2092ceebaba115e6be53410428f6f5f6ae83.tar.gz
src-d77f2092ceebaba115e6be53410428f6f5f6ae83.zip
new-bus: Remove the 'type' argument from BUS_MAP/UNMAP_RESOURCE
The public bus_map/unmap_resource() API still accepts both forms, but the internal kobj methods no longer pass the argument. Implementations which need the type now use rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44129
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/nexus.c8
-rw-r--r--sys/arm/mv/mv_pci.c14
2 files changed, 11 insertions, 11 deletions
diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c
index eb0d1a5b7ded..0cb896ce346e 100644
--- a/sys/arm/arm/nexus.c
+++ b/sys/arm/arm/nexus.c
@@ -331,7 +331,7 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid,
}
static int
-nexus_map_resource(device_t bus, device_t child, int type, struct resource *r,
+nexus_map_resource(device_t bus, device_t child, struct resource *r,
struct resource_map_request *argsp, struct resource_map *map)
{
struct resource_map_request args;
@@ -342,7 +342,7 @@ nexus_map_resource(device_t bus, device_t child, int type, struct resource *r,
if (!(rman_get_flags(r) & RF_ACTIVE))
return (ENXIO);
- switch (type) {
+ switch (rman_get_type(r)) {
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
break;
@@ -374,11 +374,11 @@ nexus_map_resource(device_t bus, device_t child, int type, struct resource *r,
}
static int
-nexus_unmap_resource(device_t bus, device_t child, int type, struct resource *r,
+nexus_unmap_resource(device_t bus, device_t child, struct resource *r,
struct resource_map *map)
{
- switch (type) {
+ switch (rman_get_type(r)) {
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
#ifdef FDT
diff --git a/sys/arm/mv/mv_pci.c b/sys/arm/mv/mv_pci.c
index 42ee3180a942..a8a6d1d50002 100644
--- a/sys/arm/mv/mv_pci.c
+++ b/sys/arm/mv/mv_pci.c
@@ -353,9 +353,9 @@ static int mv_pcib_activate_resource(device_t, device_t, int, int,
struct resource *r);
static int mv_pcib_deactivate_resource(device_t, device_t, int, int,
struct resource *r);
-static int mv_pcib_map_resource(device_t, device_t, int, struct resource *,
+static int mv_pcib_map_resource(device_t, device_t, struct resource *,
struct resource_map_request *, struct resource_map *);
-static int mv_pcib_unmap_resource(device_t, device_t, int, struct resource *,
+static int mv_pcib_unmap_resource(device_t, device_t, struct resource *,
struct resource_map *);
static int mv_pcib_read_ivar(device_t, device_t, int, uintptr_t *);
static int mv_pcib_write_ivar(device_t, device_t, int, uintptr_t);
@@ -1034,7 +1034,7 @@ mv_pcib_deactivate_resource(device_t dev, device_t child, int type, int rid,
}
static int
-mv_pcib_map_resource(device_t dev, device_t child, int type, struct resource *r,
+mv_pcib_map_resource(device_t dev, device_t child, struct resource *r,
struct resource_map_request *argsp, struct resource_map *map)
{
struct resource_map_request args;
@@ -1046,7 +1046,7 @@ mv_pcib_map_resource(device_t dev, device_t child, int type, struct resource *r,
return (ENXIO);
/* Mappings are only supported on I/O and memory resources. */
- switch (type) {
+ switch (rman_get_type(r)) {
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
break;
@@ -1066,10 +1066,10 @@ mv_pcib_map_resource(device_t dev, device_t child, int type, struct resource *r,
}
static int
-mv_pcib_unmap_resource(device_t dev, device_t child, int type,
- struct resource *r, struct resource_map *map)
+mv_pcib_unmap_resource(device_t dev, device_t child, struct resource *r,
+ struct resource_map *map)
{
- switch (type) {
+ switch (rman_get_type(r)) {
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
return (0);