summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-02-12 05:54:22 +0000
committerimp <imp@FreeBSD.org>2003-02-12 05:54:22 +0000
commit69fdce865dd81c6c7a9905ef288c04f1d54503f1 (patch)
tree4d331d732be95315d1af404b43c0ab71b1195806
parent7c1a3ea129f3d3859ce05736d0bb70cc5cb5cf73 (diff)
downloadFreeBSD-src-69fdce865dd81c6c7a9905ef288c04f1d54503f1.zip
FreeBSD-src-69fdce865dd81c6c7a9905ef288c04f1d54503f1.tar.gz
MFp4:
Don't reach inside of rman to r_dev. Use rman_get_device instead.
-rw-r--r--sys/dev/cardbus/cardbus.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c
index 322879c..01e7700 100644
--- a/sys/dev/cardbus/cardbus.c
+++ b/sys/dev/cardbus/cardbus.c
@@ -534,7 +534,7 @@ cardbus_set_resource(device_t cbdev, device_t child, int type, int rid,
}
} else {
if (rle->res == NULL) {
- } else if (rle->res->r_dev == cbdev &&
+ } else if (rman_get_device(rle->res) == cbdev &&
(!(rman_get_flags(rle->res) & RF_ACTIVE))) {
int f;
f = rman_get_flags(rle->res);
@@ -595,7 +595,7 @@ cardbus_delete_resource(device_t cbdev, device_t child, int type, int rid)
rle = resource_list_find(rl, type, rid);
if (rle) {
if (rle->res) {
- if (rle->res->r_dev != cbdev ||
+ if (rman_get_device(rle->res) != cbdev ||
rman_get_flags(rle->res) & RF_ACTIVE) {
device_printf(cbdev, "delete_resource: "
"Resource still owned by child, oops. "
@@ -652,16 +652,14 @@ cardbus_release_all_resources(device_t cbdev, struct cardbus_devinfo *dinfo)
/* Free all allocated resources */
SLIST_FOREACH(rle, &dinfo->pci.resources, link) {
if (rle->res) {
- if (rle->res->r_dev != cbdev)
+ if (rman_get_device(rle->res) != cbdev)
device_printf(cbdev, "release_all_resource: "
"Resource still owned by child, oops. "
"(type=%d, rid=%d, addr=%lx)\n",
rle->type, rle->rid,
rman_get_start(rle->res));
BUS_RELEASE_RESOURCE(device_get_parent(cbdev),
- rle->res->r_dev,
- rle->type, rle->rid,
- rle->res);
+ cbdev, rle->type, rle->rid, rle->res);
rle->res = NULL;
/*
* zero out config so the card won't acknowledge
@@ -697,7 +695,7 @@ cardbus_alloc_resource(device_t cbdev, device_t child, int type,
return NULL;
} else {
/* Release the cardbus hold on the resource */
- if (rle->res->r_dev != cbdev)
+ if (rman_get_device(rle->res) != cbdev)
return NULL;
bus_release_resource(cbdev, type, *rid, rle->res);
rle->res = NULL;
OpenPOWER on IntegriCloud