summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-pci.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2011-11-01 17:57:21 +0000
committermarius <marius@FreeBSD.org>2011-11-01 17:57:21 +0000
commit58500f4f41654b7adbb7b919fddd1d701d328e50 (patch)
treebf54ea3252298ee3374b5a6da1d4f30f5695667c /sys/dev/ata/ata-pci.c
parent1cbd492c701121efac4aff68c9ce3759acde3be0 (diff)
downloadFreeBSD-src-58500f4f41654b7adbb7b919fddd1d701d328e50.zip
FreeBSD-src-58500f4f41654b7adbb7b919fddd1d701d328e50.tar.gz
In r225931 I've missed the only other driver using the pointer returned
by rman_get_virtual(9) to access device registers sparc64 currently cares about. Ideally ata(4) should just be converted to access these using bus_space(9) read/write functions instead as there's really no reason to do it the former way. However, this part of ata-siliconimage.c should go away in favor of siis(4) sooner or later anyway and I don't have the hardware to actually test the SX4 bits of ata-promise.c. Also ideally the other architectures should also properly handle the BUS_SPACE_MAP_LINEAR flag of bus_space_map(9) so this code wouldn't need to be #ifdef'ed.
Diffstat (limited to 'sys/dev/ata/ata-pci.c')
-rw-r--r--sys/dev/ata/ata-pci.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index b0359e6..26b3628 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -153,10 +153,20 @@ ata_pci_detach(device_t dev)
}
if (ctlr->chipdeinit != NULL)
ctlr->chipdeinit(dev);
- if (ctlr->r_res2)
+ if (ctlr->r_res2) {
+#ifdef __sparc64__
+ bus_space_unmap(rman_get_bustag(ctlr->r_res2),
+ rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2));
+#endif
bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2);
- if (ctlr->r_res1)
+ }
+ if (ctlr->r_res1) {
+#ifdef __sparc64__
+ bus_space_unmap(rman_get_bustag(ctlr->r_res1),
+ rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1));
+#endif
bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, ctlr->r_res1);
+ }
return 0;
}
@@ -775,7 +785,6 @@ driver_t ata_pcichannel_driver = {
DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, 0, 0);
-
/*
* misc support fucntions
*/
@@ -936,4 +945,3 @@ ata_mode2idx(int mode)
return (mode & ATA_MODE_MASK) + 5;
return (mode & ATA_MODE_MASK) - ATA_PIO0;
}
-
OpenPOWER on IntegriCloud