aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/psim
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
commit9dbf5b0e6876d8c93890754bcc9c748339de79c0 (patch)
treee66b390b26cf9f10c541a80c8606789649e191c1 /sys/powerpc/psim
parent2baed46e85d33b1f99e6f96033acc85a9a6fbba4 (diff)
downloadsrc-9dbf5b0e6876d8c93890754bcc9c748339de79c0.tar.gz
src-9dbf5b0e6876d8c93890754bcc9c748339de79c0.zip
new-bus: Remove the 'rid' and 'type' arguments from BUS_RELEASE_RESOURCE
The public bus_release_resource() API still accepts both forms, but the internal kobj method no longer passes the arguments. Implementations which need the rid or type now use rman_get_rid() or rman_get_type() to fetch the value from the allocated resource. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D44131
Diffstat (limited to 'sys/powerpc/psim')
-rw-r--r--sys/powerpc/psim/ata_iobus.c6
-rw-r--r--sys/powerpc/psim/iobus.c13
2 files changed, 7 insertions, 12 deletions
diff --git a/sys/powerpc/psim/ata_iobus.c b/sys/powerpc/psim/ata_iobus.c
index 691e7b6fb958..5a0eea32055a 100644
--- a/sys/powerpc/psim/ata_iobus.c
+++ b/sys/powerpc/psim/ata_iobus.c
@@ -61,8 +61,7 @@ static int ata_iobus_print_child(device_t dev, device_t child);
struct resource *ata_iobus_alloc_resource(device_t, device_t, int, int *,
rman_res_t, rman_res_t, rman_res_t,
u_int);
-static int ata_iobus_release_resource(device_t, device_t, int, int,
- struct resource *);
+static int ata_iobus_release_resource(device_t, device_t, struct resource *);
static device_method_t ata_iobus_methods[] = {
/* Device interface */
@@ -192,8 +191,7 @@ ata_iobus_alloc_resource(device_t dev, device_t child, int type, int *rid,
}
static int
-ata_iobus_release_resource(device_t dev, device_t child, int type, int rid,
- struct resource *r)
+ata_iobus_release_resource(device_t dev, device_t child, struct resource *r)
{
/* no hotplug... */
return (0);
diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c
index cea6fc5fb15e..970ade9f886b 100644
--- a/sys/powerpc/psim/iobus.c
+++ b/sys/powerpc/psim/iobus.c
@@ -83,8 +83,7 @@ static int iobus_map_resource(device_t, device_t, struct resource *,
struct resource_map *);
static int iobus_unmap_resource(device_t, device_t, struct resource *,
struct resource_map *);
-static int iobus_release_resource(device_t, device_t, int, int,
- struct resource *);
+static int iobus_release_resource(device_t, device_t, struct resource *);
/*
* Bus interface definition
@@ -357,17 +356,15 @@ iobus_adjust_resource(device_t bus, device_t child, struct resource *r,
}
static int
-iobus_release_resource(device_t bus, device_t child, int type, int rid,
- struct resource *res)
+iobus_release_resource(device_t bus, device_t child, struct resource *res)
{
- switch (type) {
+ switch (rman_get_type(res)) {
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
- return (bus_generic_rman_release_resource(bus, child, type, rid,
- res));
+ return (bus_generic_rman_release_resource(bus, child, res));
case SYS_RES_IRQ:
- return (bus_generic_release_resource(bus, child, type, rid, res));
+ return (bus_generic_release_resource(bus, child, res));
default:
return (EINVAL);
}