Deleted Added
full compact
mvs_pci.c (214099) mvs_pci.c (227701)
1/*-
2 * Copyright (c) 2010 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) 2010 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/mvs/mvs_pci.c 214099 2010-10-20 07:22:34Z mav $");
28__FBSDID("$FreeBSD: head/sys/dev/mvs/mvs_pci.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/bus.h>
35#include <sys/endian.h>
36#include <sys/malloc.h>

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

172 bus_generic_attach(dev);
173 return 0;
174}
175
176static int
177mvs_detach(device_t dev)
178{
179 struct mvs_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/bus.h>
35#include <sys/endian.h>
36#include <sys/malloc.h>

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

172 bus_generic_attach(dev);
173 return 0;
174}
175
176static int
177mvs_detach(device_t dev)
178{
179 struct mvs_controller *ctlr = device_get_softc(dev);
180 device_t *children;
181 int nchildren, i;
182
183 /* Detach & delete all children */
180
181 /* Detach & delete all children */
184 if (!device_get_children(dev, &children, &nchildren)) {
185 for (i = 0; i < nchildren; i++)
186 device_delete_child(dev, children[i]);
187 free(children, M_TEMP);
188 }
182 device_delete_all_children(dev);
183
189 /* Free interrupt. */
190 if (ctlr->irq.r_irq) {
191 bus_teardown_intr(dev, ctlr->irq.r_irq,
192 ctlr->irq.handle);
193 bus_release_resource(dev, SYS_RES_IRQ,
194 ctlr->irq.r_irq_rid, ctlr->irq.r_irq);
195 }
196 pci_release_msi(dev);

--- 323 unchanged lines hidden ---
184 /* Free interrupt. */
185 if (ctlr->irq.r_irq) {
186 bus_teardown_intr(dev, ctlr->irq.r_irq,
187 ctlr->irq.handle);
188 bus_release_resource(dev, SYS_RES_IRQ,
189 ctlr->irq.r_irq_rid, ctlr->irq.r_irq);
190 }
191 pci_release_msi(dev);

--- 323 unchanged lines hidden ---