]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
Convert pci_delete_child() to a bus_child_deleted() method.
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 14 Mar 2018 19:04:40 +0000 (19:04 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 14 Mar 2018 19:04:40 +0000 (19:04 +0000)
commitba2e8eb763181d097937cb5fec5480ef2b6e9b73
tree60ebf854bb72f269540f4347424ca8e4e731b561
parent134bb0a2a38f053e372dad6233ca0c600d659b90
Convert pci_delete_child() to a bus_child_deleted() method.

Instead of providing a wrapper around device_delete_child() that the PCI
bus and child bus drivers must call explicitly, move the bulk of the logic
from pci_delete_child() into a bus_child_deleted() method
(pci_child_deleted()).  This allows PCI devices to be safely deleted via
device_delete_child().
- Add a bus_child_deleted method to the ACPI PCI bus which clears the
  device_t associated with the corresponding ACPI handle in addition to
  the normal PCI bus cleanup.
- Change cardbus_detach_card to call device_delete_children() and move
  CardBus-specific delete logic into a new cardbus_child_deleted() method.
- Use device_delete_child() instead of pci_delete_child() in the SRIOV code.
- Add a bus_child_deleted method to the OpenFirmware PCI bus drivers which
  frees the OpenFirmware device info for each PCI device.

To preserve KBI, a pci_delete_child() function is left in place that
just calls device_delete_child().

PR: 226562
Requested by: dexuan

git-svn-id: svn://svn.freebsd.org/base/stable/10@330938 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/acpica/acpi_pci.c
sys/dev/cardbus/cardbus.c
sys/dev/pci/pci.c
sys/dev/pci/pci_private.h
sys/powerpc/ofw/ofw_pcibus.c
sys/sparc64/pci/ofw_pcibus.c