Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151423006
D3926.id9469.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D3926.id9469.diff
View Options
Index: sys/dev/iicbus/iicbb.c
===================================================================
--- sys/dev/iicbus/iicbb.c
+++ sys/dev/iicbus/iicbb.c
@@ -149,22 +149,9 @@
static int
iicbb_detach(device_t dev)
{
- struct iicbb_softc *sc = (struct iicbb_softc *)device_get_softc(dev);
- device_t child;
- /*
- * We need to save child because the detach indirectly causes
- * sc->iicbus to be zeroed. Since we added the device
- * unconditionally in iicbb_attach, we need to make sure we
- * delete it here. See iicbb_child_detached. We need that
- * callback in case newbus detached our children w/o detaching
- * us (say iicbus is a module and unloaded w/o iicbb being
- * unloaded).
- */
- child = sc->iicbus;
bus_generic_detach(dev);
- if (child)
- device_delete_child(dev, child);
+ device_delete_children(dev);
return (0);
}
Index: sys/dev/iicbus/iicbus.c
===================================================================
--- sys/dev/iicbus/iicbus.c
+++ sys/dev/iicbus/iicbus.c
@@ -40,7 +40,7 @@
#include <sys/mutex.h>
#include <sys/rman.h>
#include <sys/sysctl.h>
-#include <sys/bus.h>
+#include <sys/bus.h>
#include <dev/iicbus/iiconf.h>
#include <dev/iicbus/iicbus.h>
@@ -61,7 +61,7 @@
}
#if SCAN_IICBUS
-static int
+static int
iic_probe_device(device_t dev, u_char addr)
{
int count;
@@ -127,7 +127,7 @@
bus_generic_attach(dev);
return (0);
}
-
+
static int
iicbus_detach(device_t dev)
{
@@ -135,10 +135,11 @@
iicbus_reset(dev, IIC_FASTEST, 0, NULL);
bus_generic_detach(dev);
+ device_delete_children(dev);
mtx_destroy(&sc->lock);
return (0);
}
-
+
static int
iicbus_print_child(device_t dev, device_t child)
{
Index: sys/dev/iicbus/iicoc.c
===================================================================
--- sys/dev/iicbus/iicoc.c
+++ sys/dev/iicbus/iicoc.c
@@ -229,6 +229,7 @@
iicoc_detach(device_t dev)
{
bus_generic_detach(dev);
+ device_delete_children(dev);
return (0);
}
Index: sys/dev/iicbus/iicsmb.c
===================================================================
--- sys/dev/iicbus/iicsmb.c
+++ sys/dev/iicbus/iicsmb.c
@@ -167,11 +167,9 @@
iicsmb_detach(device_t dev)
{
struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev);
-
+
bus_generic_detach(dev);
- if (sc->smbus) {
- device_delete_child(dev, sc->smbus);
- }
+ device_delete_children(dev);
mtx_destroy(&sc->lock);
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 9, 7:59 AM (15 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31126001
Default Alt Text
D3926.id9469.diff (2 KB)
Attached To
Mode
D3926: iicbus: Use device_delete_children() instead of explicit child removal
Attached
Detach File
Event Timeline
Log In to Comment