diff options
author | jhb <jhb@FreeBSD.org> | 2009-11-06 14:52:37 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2009-11-06 14:52:37 +0000 |
commit | 711ffd5555051d0353132c19110a788a312e5fad (patch) | |
tree | 405feabf6b155b3619c54467a0316d713b9284ab /sys/dev/vge | |
parent | b70da1b82c95648ac8d733329f88612a12df93bb (diff) | |
download | FreeBSD-src-711ffd5555051d0353132c19110a788a312e5fad.zip FreeBSD-src-711ffd5555051d0353132c19110a788a312e5fad.tar.gz |
Use device_printf() and if_printf() instead of printf() with an explicit
unit number and remove 'unit' members from softc.
Diffstat (limited to 'sys/dev/vge')
-rw-r--r-- | sys/dev/vge/if_vge.c | 15 | ||||
-rw-r--r-- | sys/dev/vge/if_vgevar.h | 1 |
2 files changed, 6 insertions, 10 deletions
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c index f08f8a2..a245769 100644 --- a/sys/dev/vge/if_vge.c +++ b/sys/dev/vge/if_vge.c @@ -967,8 +967,6 @@ vge_attach(dev) */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - sc->vge_unit = unit; - /* * Allocate the parent bus DMA tag appropriate for PCI. */ @@ -993,7 +991,7 @@ vge_attach(dev) ifp = sc->vge_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - printf("vge%d: can not if_alloc()\n", sc->vge_unit); + device_printf(dev, "can not if_alloc()\n"); error = ENOSPC; goto fail; } @@ -1001,7 +999,7 @@ vge_attach(dev) /* Do MII setup */ if (mii_phy_probe(dev, &sc->vge_miibus, vge_ifmedia_upd, vge_ifmedia_sts)) { - printf("vge%d: MII without any phy!\n", sc->vge_unit); + device_printf(dev, "MII without any phy!\n"); error = ENXIO; goto fail; } @@ -1736,8 +1734,7 @@ vge_encap(sc, m_head, idx) m_head, vge_dma_map_tx_desc, &arg, BUS_DMA_NOWAIT); if (error && error != EFBIG) { - printf("vge%d: can't map mbuf (error %d)\n", - sc->vge_unit, error); + if_printf(sc->vge_ifp, "can't map mbuf (error %d)\n", error); return (ENOBUFS); } @@ -1758,8 +1755,8 @@ vge_encap(sc, m_head, idx) error = bus_dmamap_load_mbuf(sc->vge_ldata.vge_mtag, map, m_head, vge_dma_map_tx_desc, &arg, BUS_DMA_NOWAIT); if (error) { - printf("vge%d: can't map mbuf (error %d)\n", - sc->vge_unit, error); + if_printf(sc->vge_ifp, "can't map mbuf (error %d)\n", + error); return (EFBIG); } } @@ -2254,7 +2251,7 @@ vge_watchdog(ifp) sc = ifp->if_softc; VGE_LOCK(sc); - printf("vge%d: watchdog timeout\n", sc->vge_unit); + if_printf(ifp, "watchdog timeout\n"); ifp->if_oerrors++; vge_txeof(sc); diff --git a/sys/dev/vge/if_vgevar.h b/sys/dev/vge/if_vgevar.h index 5d240a3..aab5228 100644 --- a/sys/dev/vge/if_vgevar.h +++ b/sys/dev/vge/if_vgevar.h @@ -108,7 +108,6 @@ struct vge_softc { device_t vge_miibus; bus_dma_tag_t vge_parent_tag; bus_dma_tag_t vge_tag; - u_int8_t vge_unit; /* interface number */ u_int8_t vge_type; int vge_if_flags; int vge_rx_consumed; |