aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iicbus/iicsmb.c
diff options
context:
space:
mode:
authorMatthew N. Dodd <mdodd@FreeBSD.org>1999-07-29 01:03:04 +0000
committerMatthew N. Dodd <mdodd@FreeBSD.org>1999-07-29 01:03:04 +0000
commit15317dd875420f6e8953f95fa7de214465187dda (patch)
tree4895cb91c66163742479e4442fcd330fed36fc9b /sys/dev/iicbus/iicsmb.c
parent7558f6aad9132f231a62b6bf2bb57f082dc0a57d (diff)
downloadsrc-15317dd875420f6e8953f95fa7de214465187dda.tar.gz
src-15317dd875420f6e8953f95fa7de214465187dda.zip
Alter the behavior of sys/kern/subr_bus.c:device_print_child()
- device_print_child() either lets the BUS_PRINT_CHILD method produce the entire device announcement message or it prints "foo0: not found\n" Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on the previous behavior of device_print_child() (printing the "foo0: <FooDevice 1.1>" bit of the announce message.) Provide bus_print_child_header() and bus_print_child_footer() to actually print the output for bus_generic_print_child(). These functions should be used whenever possible (unless you can just use bus_generic_print_child()) The BUS_PRINT_CHILD method now returns int instead of void. Modify everything else that defines or uses a BUS_PRINT_CHILD method to comply with the above changes. - Devices are 'on' a bus, not 'at' it. - If a custom BUS_PRINT_CHILD method does the same thing as bus_generic_print_child(), use bus_generic_print_child() - Use device_get_nameunit() instead of both device_get_name() and device_get_unit() - All BUS_PRINT_CHILD methods return the number of characters output. Reviewed by: dfr, peter
Notes
Notes: svn path=/head/; revision=49195
Diffstat (limited to 'sys/dev/iicbus/iicsmb.c')
-rw-r--r--sys/dev/iicbus/iicsmb.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c
index 4319ca0ba4c0..4cea0b5dc2a7 100644
--- a/sys/dev/iicbus/iicsmb.c
+++ b/sys/dev/iicbus/iicsmb.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicsmb.c,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: iicsmb.c,v 1.3 1999/05/08 21:59:05 dfr Exp $
*
*/
@@ -83,7 +83,6 @@ struct iicsmb_softc {
static int iicsmb_probe(device_t);
static int iicsmb_attach(device_t);
-static void iicsmb_print_child(device_t, device_t);
static void iicsmb_intr(device_t dev, int event, char *buf);
static int iicsmb_callback(device_t dev, int index, caddr_t data);
@@ -106,7 +105,7 @@ static device_method_t iicsmb_methods[] = {
DEVMETHOD(device_attach, iicsmb_attach),
/* bus interface */
- DEVMETHOD(bus_print_child, iicsmb_print_child),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
/* iicbus interface */
DEVMETHOD(iicbus_intr, iicsmb_intr),
@@ -157,14 +156,6 @@ iicsmb_attach(device_t dev)
return (0);
}
-static void
-iicsmb_print_child(device_t bus, device_t dev)
-{
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
-
- return;
-}
-
/*
* iicsmb_intr()
*