ahci_pci.c (227635) | ahci_pci.c (227701) |
---|---|
1/*- 2 * Copyright (c) 2009 Alexander Motin <mav@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009 Alexander Motin <mav@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/ahci/ahci.c 227635 2011-11-17 20:46:51Z mav $"); | 28__FBSDID("$FreeBSD: head/sys/dev/ahci/ahci.c 227701 2011-11-19 10:11:50Z hselasky $"); |
29 30#include <sys/param.h> 31#include <sys/module.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/ata.h> 35#include <sys/bus.h> 36#include <sys/conf.h> --- 473 unchanged lines hidden (view full) --- 510 bus_generic_attach(dev); 511 return 0; 512} 513 514static int 515ahci_detach(device_t dev) 516{ 517 struct ahci_controller *ctlr = device_get_softc(dev); | 29 30#include <sys/param.h> 31#include <sys/module.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/ata.h> 35#include <sys/bus.h> 36#include <sys/conf.h> --- 473 unchanged lines hidden (view full) --- 510 bus_generic_attach(dev); 511 return 0; 512} 513 514static int 515ahci_detach(device_t dev) 516{ 517 struct ahci_controller *ctlr = device_get_softc(dev); |
518 device_t *children; 519 int nchildren, i; | 518 int i; |
520 521 /* Detach & delete all children */ | 519 520 /* Detach & delete all children */ |
522 if (!device_get_children(dev, &children, &nchildren)) { 523 for (i = 0; i < nchildren; i++) 524 device_delete_child(dev, children[i]); 525 free(children, M_TEMP); 526 } | 521 device_delete_all_children(dev); 522 |
527 /* Free interrupts. */ 528 for (i = 0; i < ctlr->numirqs; i++) { 529 if (ctlr->irqs[i].r_irq) { 530 bus_teardown_intr(dev, ctlr->irqs[i].r_irq, 531 ctlr->irqs[i].handle); 532 bus_release_resource(dev, SYS_RES_IRQ, 533 ctlr->irqs[i].r_irq_rid, ctlr->irqs[i].r_irq); 534 } --- 2463 unchanged lines hidden --- | 523 /* Free interrupts. */ 524 for (i = 0; i < ctlr->numirqs; i++) { 525 if (ctlr->irqs[i].r_irq) { 526 bus_teardown_intr(dev, ctlr->irqs[i].r_irq, 527 ctlr->irqs[i].handle); 528 bus_release_resource(dev, SYS_RES_IRQ, 529 ctlr->irqs[i].r_irq_rid, ctlr->irqs[i].r_irq); 530 } --- 2463 unchanged lines hidden --- |