diff options
author | John Baldwin <jhb@FreeBSD.org> | 2006-09-11 19:41:31 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2006-09-11 19:41:31 +0000 |
commit | 4288462f38a9c66a0559502d4300dd0a71eb062d (patch) | |
tree | 8dede9a77a810fe11c00d0e49e437ddb74494ec2 /sys/kern/bus_if.m | |
parent | 5c24178d8ee9366a2a804a1b12aed98aba86f5a6 (diff) | |
download | src-4288462f38a9c66a0559502d4300dd0a71eb062d.tar.gz src-4288462f38a9c66a0559502d4300dd0a71eb062d.zip |
Add a default method for BUS_ADD_CHILD() that just calls
device_add_child_ordered(). Previously, a device driver that wanted to
add a new child device in its identify routine had to know if the parent
driver had a custom bus_add_child method and use BUS_ADD_CHILD() in that
case, otherwise use device_add_child(). Getting it wrong in either
direction would result in panics or failure to add the child device. Now,
BUS_ADD_CHILD() always works isolating child drivers from having to know
intimate details about the parent driver.
Discussed with: imp
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=162227
Diffstat (limited to 'sys/kern/bus_if.m')
-rw-r--r-- | sys/kern/bus_if.m | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m index 529b506f1b68..bd848f2b7d2d 100644 --- a/sys/kern/bus_if.m +++ b/sys/kern/bus_if.m @@ -194,7 +194,7 @@ METHOD device_t add_child { int _order; const char *_name; int _unit; -}; +} DEFAULT bus_generic_add_child; /** * @brief Allocate a system resource |