Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145302249
D6020.1777608874.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6020.1777608874.diff
View Options
Index: head/sys/dev/pci/pci.c
===================================================================
--- head/sys/dev/pci/pci.c
+++ head/sys/dev/pci/pci.c
@@ -97,9 +97,7 @@
struct resource_list *rl, int force, int prefetch);
static int pci_probe(device_t dev);
static int pci_attach(device_t dev);
-#ifdef PCI_RES_BUS
static int pci_detach(device_t dev);
-#endif
static void pci_load_vendor_data(void);
static int pci_describe_parse_line(char **ptr, int *vendor,
int *device, char **desc);
@@ -133,11 +131,7 @@
/* Device interface */
DEVMETHOD(device_probe, pci_probe),
DEVMETHOD(device_attach, pci_attach),
-#ifdef PCI_RES_BUS
DEVMETHOD(device_detach, pci_detach),
-#else
- DEVMETHOD(device_detach, bus_generic_detach),
-#endif
DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, pci_resume),
@@ -4145,20 +4139,25 @@
return (bus_generic_attach(dev));
}
-#ifdef PCI_RES_BUS
static int
pci_detach(device_t dev)
{
+#ifdef PCI_RES_BUS
struct pci_softc *sc;
+#endif
int error;
error = bus_generic_detach(dev);
if (error)
return (error);
sc = device_get_softc(dev);
- return (bus_release_resource(dev, PCI_RES_BUS, 0, sc->sc_bus));
-}
+#ifdef PCI_RES_BUS
+ error = bus_release_resource(dev, PCI_RES_BUS, 0, sc->sc_bus);
+ if (error)
+ return (error);
#endif
+ return (device_delete_children(dev));
+}
static void
pci_set_power_child(device_t dev, device_t child, int state)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 1, 4:14 AM (9 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28496466
Default Alt Text
D6020.1777608874.diff (1 KB)
Attached To
Mode
D6020: Fix PCI bus detach to delete child devices.
Attached
Detach File
Event Timeline
Log In to Comment