siis.c (d745c852becf3792a2185003947324721209195a) siis.c (11bcf702f4200a351f06b549e14bc9ea4fc76dcc)
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

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

200 bus_generic_attach(dev);
201 return 0;
202}
203
204static int
205siis_detach(device_t dev)
206{
207 struct siis_controller *ctlr = device_get_softc(dev);
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

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

200 bus_generic_attach(dev);
201 return 0;
202}
203
204static int
205siis_detach(device_t dev)
206{
207 struct siis_controller *ctlr = device_get_softc(dev);
208 device_t *children;
209 int nchildren, i;
210
211 /* Detach & delete all children */
208
209 /* Detach & delete all children */
212 if (!device_get_children(dev, &children, &nchildren)) {
213 for (i = 0; i < nchildren; i++)
214 device_delete_child(dev, children[i]);
215 free(children, M_TEMP);
216 }
210 device_delete_all_children(dev);
211
217 /* Free interrupts. */
218 if (ctlr->irq.r_irq) {
219 bus_teardown_intr(dev, ctlr->irq.r_irq,
220 ctlr->irq.handle);
221 bus_release_resource(dev, SYS_RES_IRQ,
222 ctlr->irq.r_irq_rid, ctlr->irq.r_irq);
223 }
224 pci_release_msi(dev);

--- 1765 unchanged lines hidden ---
212 /* Free interrupts. */
213 if (ctlr->irq.r_irq) {
214 bus_teardown_intr(dev, ctlr->irq.r_irq,
215 ctlr->irq.handle);
216 bus_release_resource(dev, SYS_RES_IRQ,
217 ctlr->irq.r_irq_rid, ctlr->irq.r_irq);
218 }
219 pci_release_msi(dev);

--- 1765 unchanged lines hidden ---