Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110653932
D22902.id69331.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D22902.id69331.diff
View Options
Index: head/sys/dev/acpica/acpi.c
===================================================================
--- head/sys/dev/acpica/acpi.c
+++ head/sys/dev/acpica/acpi.c
@@ -121,6 +121,7 @@
static int acpi_print_child(device_t bus, device_t child);
static void acpi_probe_nomatch(device_t bus, device_t child);
static void acpi_driver_added(device_t dev, driver_t *driver);
+static void acpi_child_deleted(device_t dev, device_t child);
static int acpi_read_ivar(device_t dev, device_t child, int index,
uintptr_t *result);
static int acpi_write_ivar(device_t dev, device_t child, int index,
@@ -199,6 +200,7 @@
DEVMETHOD(bus_print_child, acpi_print_child),
DEVMETHOD(bus_probe_nomatch, acpi_probe_nomatch),
DEVMETHOD(bus_driver_added, acpi_driver_added),
+ DEVMETHOD(bus_child_deleted, acpi_child_deleted),
DEVMETHOD(bus_read_ivar, acpi_read_ivar),
DEVMETHOD(bus_write_ivar, acpi_write_ivar),
DEVMETHOD(bus_get_resource_list, acpi_get_rlist),
@@ -907,6 +909,18 @@
}
/*
+ * Handle device deletion.
+ */
+static void
+acpi_child_deleted(device_t dev, device_t child)
+{
+ struct acpi_device *dinfo = device_get_ivars(child);
+
+ if (acpi_get_device(dinfo->ad_handle) == child)
+ AcpiDetachData(dinfo->ad_handle, acpi_fake_objhandler);
+}
+
+/*
* Handle per-device ivars
*/
static int
@@ -1791,10 +1805,8 @@
return (status);
/* Remove the old child and its connection to the handle. */
- if (old_dev != NULL) {
+ if (old_dev != NULL)
device_delete_child(device_get_parent(old_dev), old_dev);
- AcpiDetachData(h, acpi_fake_objhandler);
- }
/* Recreate the handle association if the user created a device. */
if (dev != NULL)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 22, 12:18 PM (56 m, 32 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16771279
Default Alt Text
D22902.id69331.diff (1 KB)
Attached To
Mode
D22902: [acpi] Fix stalled value returned by acpi_get_device() after newbus device has been deleted
Attached
Detach File
Event Timeline
Log In to Comment