Deleted Added
full compact
ata-pci.c (227000) ata-pci.c (227701)
1/*-
2 * Copyright (c) 1998 - 2008 S�ren Schmidt <sos@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) 1998 - 2008 S�ren Schmidt <sos@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/ata/ata-pci.c 227000 2011-11-01 17:57:21Z marius $");
28__FBSDID("$FreeBSD: head/sys/dev/ata/ata-pci.c 227701 2011-11-19 10:11:50Z hselasky $");
29
30#include "opt_ata.h"
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/module.h>
35#include <sys/ata.h>
36#include <sys/bus.h>

--- 94 unchanged lines hidden (view full) ---

131 bus_generic_attach(dev);
132 return 0;
133}
134
135int
136ata_pci_detach(device_t dev)
137{
138 struct ata_pci_controller *ctlr = device_get_softc(dev);
29
30#include "opt_ata.h"
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/module.h>
35#include <sys/ata.h>
36#include <sys/bus.h>

--- 94 unchanged lines hidden (view full) ---

131 bus_generic_attach(dev);
132 return 0;
133}
134
135int
136ata_pci_detach(device_t dev)
137{
138 struct ata_pci_controller *ctlr = device_get_softc(dev);
139 device_t *children;
140 int nchildren, i;
141
142 /* detach & delete all children */
139
140 /* detach & delete all children */
143 if (!device_get_children(dev, &children, &nchildren)) {
144 for (i = 0; i < nchildren; i++)
145 device_delete_child(dev, children[i]);
146 free(children, M_TEMP);
147 }
141 device_delete_all_children(dev);
142
148 if (ctlr->r_irq) {
149 bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle);
150 bus_release_resource(dev, SYS_RES_IRQ, ctlr->r_irq_rid, ctlr->r_irq);
151 if (ctlr->r_irq_rid != ATA_IRQ_RID)
152 pci_release_msi(dev);
153 }
154 if (ctlr->chipdeinit != NULL)
155 ctlr->chipdeinit(dev);

--- 792 unchanged lines hidden ---
143 if (ctlr->r_irq) {
144 bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle);
145 bus_release_resource(dev, SYS_RES_IRQ, ctlr->r_irq_rid, ctlr->r_irq);
146 if (ctlr->r_irq_rid != ATA_IRQ_RID)
147 pci_release_msi(dev);
148 }
149 if (ctlr->chipdeinit != NULL)
150 ctlr->chipdeinit(dev);

--- 792 unchanged lines hidden ---