diff options
author | jmg <jmg@FreeBSD.org> | 2006-04-20 01:44:16 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 2006-04-20 01:44:16 +0000 |
commit | c5ebe3714a388f835b18e98181c2a1485dd3555b (patch) | |
tree | ede671591aacc9b92a4d43c773913482c78ac894 /sys | |
parent | 8299c3aeb9d6b503bf69084d6c1529b34ae2c72a (diff) | |
download | FreeBSD-src-c5ebe3714a388f835b18e98181c2a1485dd3555b.zip FreeBSD-src-c5ebe3714a388f835b18e98181c2a1485dd3555b.tar.gz |
const'ify resource_spec to note that we won't be changing anything while
releasing resources... also, NULL out the resources as we free them...
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_bus.c | 6 | ||||
-rw-r--r-- | sys/sys/bus.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 5610f38..44dcd47 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3355,15 +3355,17 @@ bus_alloc_resources(device_t dev, struct resource_spec *rs, } void -bus_release_resources(device_t dev, struct resource_spec *rs, +bus_release_resources(device_t dev, const struct resource_spec *rs, struct resource **res) { int i; for (i = 0; rs[i].type != -1; i++) - if (res[i] != NULL) + if (res[i] != NULL) { bus_release_resource( dev, rs[i].type, rs[i].rid, res[i]); + res[i] = NULL; + } } /** diff --git a/sys/sys/bus.h b/sys/sys/bus.h index fd96571..b97a8d8 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -297,7 +297,7 @@ struct resource_spec { }; int bus_alloc_resources(device_t dev, struct resource_spec *rs, struct resource **res); -void bus_release_resources(device_t dev, struct resource_spec *rs, struct resource **res); +void bus_release_resources(device_t dev, const struct resource_spec *rs, struct resource **res); struct resource *bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end, u_long count, |