ahci.c (72a61203fc033650d9bea2d8fe2e5eae37e0926e) | ahci.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 --- 501 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); | 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 --- 501 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 --- |