summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>1999-07-29 01:03:04 +0000
committermdodd <mdodd@FreeBSD.org>1999-07-29 01:03:04 +0000
commit1b3328c30076a4872fb76549719ee41c4f633e6a (patch)
tree08fbd565ea1bf201e2bfcfcd2a4119c82ef665a7 /sys/dev
parent0d84c8efb0a2e4b063d0c818f89eb17ee4bc6e47 (diff)
downloadFreeBSD-src-1b3328c30076a4872fb76549719ee41c4f633e6a.zip
FreeBSD-src-1b3328c30076a4872fb76549719ee41c4f633e6a.tar.gz
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
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/atkbdc/atkbdc_isa.c15
-rw-r--r--sys/dev/atkbdc/atkbdc_subr.c15
-rw-r--r--sys/dev/bktr/bktr_i2c.c13
-rw-r--r--sys/dev/eisa/eisaconf.c15
-rw-r--r--sys/dev/fdc/fdc.c11
-rw-r--r--sys/dev/ida/ida_pci.c11
-rw-r--r--sys/dev/iicbus/iicbb.c19
-rw-r--r--sys/dev/iicbus/iicbus.c20
-rw-r--r--sys/dev/iicbus/iicsmb.c13
-rw-r--r--sys/dev/pcf/pcf.c14
-rw-r--r--sys/dev/pci/pci.c18
-rw-r--r--sys/dev/ppbus/lpbb.c13
-rw-r--r--sys/dev/smbus/smbus.c14
-rw-r--r--sys/dev/usb/usbdi.c18
14 files changed, 99 insertions, 110 deletions
diff --git a/sys/dev/atkbdc/atkbdc_isa.c b/sys/dev/atkbdc/atkbdc_isa.c
index 0c57bc3..387f9a5 100644
--- a/sys/dev/atkbdc/atkbdc_isa.c
+++ b/sys/dev/atkbdc/atkbdc_isa.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atkbdc_isa.c,v 1.8 1999/05/30 11:12:27 dfr Exp $
+ * $Id: atkbdc_isa.c,v 1.9 1999/06/29 17:35:09 yokota Exp $
*/
#include "atkbdc.h"
@@ -59,7 +59,7 @@ devclass_t atkbdc_devclass;
static int atkbdc_probe(device_t dev);
static int atkbdc_attach(device_t dev);
-static void atkbdc_print_child(device_t bus, device_t dev);
+static int atkbdc_print_child(device_t bus, device_t dev);
static int atkbdc_read_ivar(device_t bus, device_t dev, int index,
u_long *val);
static int atkbdc_write_ivar(device_t bus, device_t dev, int index,
@@ -201,19 +201,22 @@ atkbdc_attach(device_t dev)
return 0;
}
-static void
+static int
atkbdc_print_child(device_t bus, device_t dev)
{
atkbdc_device_t *kbdcdev;
+ int retval = 0;
kbdcdev = (atkbdc_device_t *)device_get_ivars(dev);
+ retval += bus_print_child_header(bus, dev);
if (kbdcdev->flags != 0)
- printf(" flags 0x%x", kbdcdev->flags);
+ retval += printf(" flags 0x%x", kbdcdev->flags);
if (kbdcdev->irq != -1)
- printf(" irq %d", kbdcdev->irq);
+ retval += printf(" irq %d", kbdcdev->irq);
+ retval += bus_print_child_footer(bus, dev);
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
+ return (retval);
}
static int
diff --git a/sys/dev/atkbdc/atkbdc_subr.c b/sys/dev/atkbdc/atkbdc_subr.c
index 0c57bc3..387f9a5 100644
--- a/sys/dev/atkbdc/atkbdc_subr.c
+++ b/sys/dev/atkbdc/atkbdc_subr.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: atkbdc_isa.c,v 1.8 1999/05/30 11:12:27 dfr Exp $
+ * $Id: atkbdc_isa.c,v 1.9 1999/06/29 17:35:09 yokota Exp $
*/
#include "atkbdc.h"
@@ -59,7 +59,7 @@ devclass_t atkbdc_devclass;
static int atkbdc_probe(device_t dev);
static int atkbdc_attach(device_t dev);
-static void atkbdc_print_child(device_t bus, device_t dev);
+static int atkbdc_print_child(device_t bus, device_t dev);
static int atkbdc_read_ivar(device_t bus, device_t dev, int index,
u_long *val);
static int atkbdc_write_ivar(device_t bus, device_t dev, int index,
@@ -201,19 +201,22 @@ atkbdc_attach(device_t dev)
return 0;
}
-static void
+static int
atkbdc_print_child(device_t bus, device_t dev)
{
atkbdc_device_t *kbdcdev;
+ int retval = 0;
kbdcdev = (atkbdc_device_t *)device_get_ivars(dev);
+ retval += bus_print_child_header(bus, dev);
if (kbdcdev->flags != 0)
- printf(" flags 0x%x", kbdcdev->flags);
+ retval += printf(" flags 0x%x", kbdcdev->flags);
if (kbdcdev->irq != -1)
- printf(" irq %d", kbdcdev->irq);
+ retval += printf(" irq %d", kbdcdev->irq);
+ retval += bus_print_child_footer(bus, dev);
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
+ return (retval);
}
static int
diff --git a/sys/dev/bktr/bktr_i2c.c b/sys/dev/bktr/bktr_i2c.c
index eec0642..a3a1fdd 100644
--- a/sys/dev/bktr/bktr_i2c.c
+++ b/sys/dev/bktr/bktr_i2c.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bt848_i2c.c,v 1.4 1999/05/10 10:08:05 roger Exp $
+ * $Id: bt848_i2c.c,v 1.5 1999/07/03 20:17:01 peter Exp $
*
*/
@@ -91,7 +91,6 @@ struct bt_data btdata[NBKTR];
static int bti2c_probe(device_t);
static int bti2c_attach(device_t);
-static void bti2c_print_child(device_t, device_t);
static int bti2c_iic_callback(device_t, int, caddr_t *);
static void bti2c_iic_setlines(device_t, int, int);
@@ -111,7 +110,7 @@ static device_method_t bti2c_methods[] = {
DEVMETHOD(device_attach, bti2c_attach),
/* bus interface */
- DEVMETHOD(bus_print_child, bti2c_print_child),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
/* iicbb interface */
DEVMETHOD(iicbb_callback, bti2c_iic_callback),
@@ -193,14 +192,6 @@ bti2c_attach(device_t dev)
return (0);
}
-static void
-bti2c_print_child(device_t bus, device_t dev)
-{
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
-
- return;
-}
-
static int
bti2c_smb_callback(device_t dev, int index, caddr_t *data)
{
diff --git a/sys/dev/eisa/eisaconf.c b/sys/dev/eisa/eisaconf.c
index 5fa1113..53650a1 100644
--- a/sys/dev/eisa/eisaconf.c
+++ b/sys/dev/eisa/eisaconf.c
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: eisaconf.c,v 1.46 1999/06/22 09:44:00 peter Exp $
+ * $Id: eisaconf.c,v 1.47 1999/07/11 13:42:35 dfr Exp $
*/
#include "opt_eisa.h"
@@ -212,12 +212,17 @@ eisa_probe_nomatch(device_t dev, device_t child)
return;
}
-static void
+static int
eisa_print_child(device_t dev, device_t child)
{
- /* XXX print resource descriptions? */
- printf(" at slot %d", eisa_get_slot(child));
- printf(" on %s", device_get_nameunit(dev));
+ int retval = 0;
+
+ bus_print_child_header(dev, child);
+
+ retval += printf(" on %s slot %d", device_get_nameunit(dev),
+ eisa_get_slot(child));
+
+ return (retval);
}
static int
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 597d2da..eaa5b0f 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -47,7 +47,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.148 1999/07/04 14:58:32 phk Exp $
+ * $Id: fd.c,v 1.149 1999/07/21 12:19:44 joerg Exp $
*
*/
@@ -757,11 +757,16 @@ fdc_attach(device_t dev)
return (bus_generic_attach(dev));
}
-static void
+static int
fdc_print_child(device_t me, device_t child)
{
- printf(" at %s%d drive %d", device_get_name(me), device_get_unit(me),
+ int retval = 0;
+
+ retval += bus_print_child_header(me, child);
+ retval += printf(" on %s drive %d\n", device_get_nameunit(me),
*(int *)device_get_ivars(child));
+
+ return (retval);
}
static int
diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c
index 23446f1..6f5e260 100644
--- a/sys/dev/ida/ida_pci.c
+++ b/sys/dev/ida/ida_pci.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ida_pci.c,v 1.1 1999/06/24 03:32:07 jlemon Exp $
+ * $Id: ida_pci.c,v 1.2 1999/07/03 20:17:02 peter Exp $
*/
#include <sys/param.h>
@@ -69,13 +69,12 @@ static struct {
static int ida_pci_probe(device_t dev);
static int ida_pci_attach(device_t dev);
-static void ida_pci_print_child(device_t bus, device_t dev);
static device_method_t ida_pci_methods[] = {
DEVMETHOD(device_probe, ida_pci_probe),
DEVMETHOD(device_attach, ida_pci_attach),
- DEVMETHOD(bus_print_child, ida_pci_print_child),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
{ 0, 0 }
};
@@ -185,10 +184,4 @@ ida_pci_attach(device_t dev)
return (0);
}
-static void
-ida_pci_print_child(device_t bus, device_t dev)
-{
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
-}
-
DRIVER_MODULE(ida, pci, ida_pci_driver, ida_devclass, 0, 0);
diff --git a/sys/dev/iicbus/iicbb.c b/sys/dev/iicbus/iicbb.c
index 1502ca4..df46c1a 100644
--- a/sys/dev/iicbus/iicbb.c
+++ b/sys/dev/iicbus/iicbb.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicbb.c,v 1.3 1999/01/28 15:50:24 roger Exp $
+ * $Id: iicbb.c,v 1.4 1999/05/08 21:59:04 dfr Exp $
*
*/
@@ -70,7 +70,7 @@ struct iicbb_softc {
static int iicbb_probe(device_t);
static int iicbb_attach(device_t);
-static void iicbb_print_child(device_t, device_t);
+static int iicbb_print_child(device_t, device_t);
static int iicbb_callback(device_t, int, caddr_t);
static int iicbb_start(device_t, u_char, int);
@@ -119,27 +119,28 @@ static int iicbb_attach(device_t dev)
return (0);
}
-static void
+static int
iicbb_print_child(device_t bus, device_t dev)
{
int error;
+ int retval = 0;
u_char oldaddr;
+ retval += bus_print_child_header(bus, dev);
/* retrieve the interface I2C address */
error = IICBB_RESET(device_get_parent(bus), IIC_FASTEST, 0, &oldaddr);
if (error == IIC_ENOADDR) {
- printf(" on %s%d master-only", device_get_name(bus),
- device_get_unit(bus));
-
+ retval += printf(" on %s master-only\n",
+ device_get_nameunit(bus));
} else {
/* restore the address */
IICBB_RESET(device_get_parent(bus), IIC_FASTEST, oldaddr, NULL);
- printf(" on %s%d addr 0x%x", device_get_name(bus),
- device_get_unit(bus), oldaddr & 0xff);
+ retval += printf(" on %s addr 0x%x\n",
+ device_get_nameunit(bus), oldaddr & 0xff);
}
- return;
+ return (retval);
}
#define I2C_SET(dev,ctrl,data) \
diff --git a/sys/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c
index 50e1dd1..e97cbfb 100644
--- a/sys/dev/iicbus/iicbus.c
+++ b/sys/dev/iicbus/iicbus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicbus.c,v 1.8 1999/04/11 02:55:52 eivind Exp $
+ * $Id: iicbus.c,v 1.9 1999/05/08 21:59:04 dfr Exp $
*
*/
@@ -92,7 +92,7 @@ static devclass_t iicbus_devclass;
*/
static int iicbus_probe(device_t);
static int iicbus_attach(device_t);
-static void iicbus_print_child(device_t, device_t);
+static int iicbus_print_child(device_t, device_t);
static int iicbus_read_ivar(device_t , device_t, int, u_long *);
static int iicbus_write_ivar(device_t , device_t, int, u_long);
@@ -231,27 +231,29 @@ iicbus_null_repeated_start(device_t dev, u_char addr)
return (IIC_ENOTSUPP);
}
-static void
+static int
iicbus_print_child(device_t bus, device_t dev)
{
struct iicbus_device* iicdev = DEVTOIICBUS(dev);
+ int retval = 0;
+
+ retval += bus_print_child_header(bus, dev);
switch (iicdev->iicd_class) {
case IICBUS_DEVICE_CLASS:
- printf(" on %s%d addr 0x%x", device_get_name(bus),
- device_get_unit(bus), iicdev->iicd_addr);
+ retval += printf(" on %s addr 0x%x\n",
+ device_get_nameunit(bus), iicdev->iicd_addr);
break;
case IICBUS_DRIVER_CLASS:
- printf(" on %s%d", device_get_name(bus),
- device_get_unit(bus));
+ retval += bus_print_child_footer(bus, dev);
break;
default:
- panic("%s: unknown class!", __FUNCTION__);
+ panic("%s: unknown class!\n", __FUNCTION__);
}
- return;
+ return (retval);
}
static int
diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c
index 4319ca0..4cea0b5 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()
*
diff --git a/sys/dev/pcf/pcf.c b/sys/dev/pcf/pcf.c
index 94d685b..e5498b4 100644
--- a/sys/dev/pcf/pcf.c
+++ b/sys/dev/pcf/pcf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pcf.c,v 1.8 1999/05/06 18:54:18 peter Exp $
+ * $Id: pcf.c,v 1.9 1999/05/08 21:59:27 dfr Exp $
*
*/
#include <sys/param.h>
@@ -103,7 +103,7 @@ struct isa_driver pcfdriver = {
static int pcf_probe(device_t);
static int pcf_attach(device_t);
-static void pcf_print_child(device_t, device_t);
+static int pcf_print_child(device_t, device_t);
static int pcf_repeated_start(device_t, u_char, int);
static int pcf_start(device_t, u_char, int);
@@ -219,15 +219,17 @@ pcf_attach(device_t pcfdev)
return (0);
}
-static void
+static int
pcf_print_child(device_t bus, device_t dev)
{
struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(bus);
+ int retval = 0;
- printf(" on %s%d addr 0x%x", device_get_name(bus),
- device_get_unit(bus), (int)pcf->pcf_addr);
+ retval += bus_print_child_header(bus, dev);
+ retval += printf(" on %s addr 0x%x\n", device_get_nameunit(bus),
+ (int)pcf->pcf_addr);
- return;
+ return (retval);
}
/*
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index c6184da..78b0cda 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pci.c,v 1.112 1999/07/27 05:08:36 mdodd Exp $
+ * $Id: pci.c,v 1.113 1999/07/28 07:57:47 dfr Exp $
*
*/
@@ -1116,18 +1116,26 @@ pci_new_probe(device_t dev)
return 0;
}
-static void
+static int
pci_print_child(device_t dev, device_t child)
{
struct pci_devinfo *dinfo;
pcicfgregs *cfg;
+ int retval = 0;
dinfo = device_get_ivars(child);
cfg = &dinfo->cfg;
+
+ retval += bus_print_child_header(dev, child);
+
if (cfg->intpin > 0 && cfg->intline != 255)
- printf(" irq %d", cfg->intline);
- printf(" at device %d.%d", pci_get_slot(child), pci_get_function(child));
- printf(" on %s%d", device_get_name(dev), device_get_unit(dev));
+ retval += printf(" irq %d", cfg->intline);
+ retval += printf(" at device %d.%d", pci_get_slot(child),
+ pci_get_function(child));
+
+ retval += bus_print_child_footer(dev, child);
+
+ return (retval);
}
static void
diff --git a/sys/dev/ppbus/lpbb.c b/sys/dev/ppbus/lpbb.c
index e3ce6f0..08f4540 100644
--- a/sys/dev/ppbus/lpbb.c
+++ b/sys/dev/ppbus/lpbb.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: lpbb.c,v 1.4 1999/01/10 12:04:54 nsouch Exp $
+ * $Id: lpbb.c,v 1.5 1999/05/08 21:59:06 dfr Exp $
*
*/
@@ -62,7 +62,6 @@ static int lpbb_detect(struct lpbb_softc *);
static int lpbb_probe(device_t);
static int lpbb_attach(device_t);
-static void lpbb_print_child(device_t, device_t);
static int lpbb_callback(device_t, int, caddr_t *);
static void lpbb_setlines(device_t, int, int);
@@ -77,7 +76,7 @@ static device_method_t lpbb_methods[] = {
DEVMETHOD(device_attach, lpbb_attach),
/* bus interface */
- DEVMETHOD(bus_print_child, lpbb_print_child),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
/* iicbb interface */
DEVMETHOD(iicbb_callback, lpbb_callback),
@@ -307,12 +306,4 @@ lpbb_getdataline(device_t dev)
return (getSDA(sc));
}
-static void
-lpbb_print_child(device_t bus, device_t dev)
-{
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
-
- return;
-}
-
DRIVER_MODULE(lpbb, root, lpbb_driver, lpbb_devclass, 0, 0);
diff --git a/sys/dev/smbus/smbus.c b/sys/dev/smbus/smbus.c
index cd16f3c..2f2632e 100644
--- a/sys/dev/smbus/smbus.c
+++ b/sys/dev/smbus/smbus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: smbus.c,v 1.8 1999/02/13 17:57:19 nsouch Exp $
+ * $Id: smbus.c,v 1.9 1999/05/08 21:59:08 dfr Exp $
*
*/
#include <sys/param.h>
@@ -64,7 +64,6 @@ static devclass_t smbus_devclass;
*/
static int smbus_probe(device_t);
static int smbus_attach(device_t);
-static void smbus_print_child(device_t, device_t);
#if 0
static int smbus_read_ivar(device_t , device_t, int, u_long *);
@@ -78,7 +77,7 @@ static device_method_t smbus_methods[] = {
DEVMETHOD(device_shutdown, bus_generic_shutdown),
/* bus interface */
- DEVMETHOD(bus_print_child, smbus_print_child),
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
DEVMETHOD(bus_read_ivar, bus_generic_read_ivar),
DEVMETHOD(bus_write_ivar, bus_generic_write_ivar),
@@ -132,15 +131,6 @@ smbus_generic_intr(device_t dev, u_char devaddr, char low, char high)
return;
}
-static void
-smbus_print_child(device_t bus, device_t dev)
-{
-
- printf(" on %s%d", device_get_name(bus), device_get_unit(bus));
-
- return;
-}
-
#if 0
static int
smbus_read_ivar(device_t bus, device_t dev, int index, u_long* result)
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 53f1b0d..5439dc5 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1224,30 +1224,34 @@ usbd_get_endpoint_descriptor(iface, address)
}
#if defined(__FreeBSD__)
-void
+int
usbd_print_child(device_t parent, device_t child)
{
/*
struct usb_softc *sc = device_get_softc(child);
*/
+ int retval = 0;
- printf(" at %s%d", device_get_name(parent), device_get_unit(parent));
+ retval += bus_print_child_header(parent, child);
+ retval += bus_print_child_footer(parent, child);
/* XXX How do we get to the usbd_device_handle???
usbd_device_handle dev = invalidadosch;
- printf(" addr %d", dev->addr);
+ retval += printf(" addr %d\n", dev->addr);
if (bootverbose) {
if (dev->lowspeed)
- printf(", lowspeed");
+ retval += printf(", lowspeed");
if (dev->self_powered)
- printf(", self powered");
+ retval += printf(", self powered");
else
- printf(", %dmA", dev->power);
- printf(", config %d", dev->config);
+ retval += printf(", %dmA", dev->power);
+ retval += printf(", config %d", dev->config);
}
*/
+
+ return (retval);
}
/* Reconfigure all the USB busses in the system. */
OpenPOWER on IntegriCloud