From f2940816a85f0df6e5ae06331f3ea8b02b853695 Mon Sep 17 00:00:00 2001 From: Pyun YongHyeon Date: Fri, 8 Jan 2010 21:25:52 +0000 Subject: [PATCH] MFC r200519-200522 r200519: Remove register keyword. r200520: Prefer device_printf(9) to printf(9). r200521: Fix spelling in comment. r200522: Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9). --- sys/dev/vge/if_vge.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c index 08c183b72c4..883947038d4 100644 --- a/sys/dev/vge/if_vge.c +++ b/sys/dev/vge/if_vge.c @@ -233,7 +233,7 @@ vge_eeprom_getword(sc, addr, dest) int addr; u_int16_t *dest; { - register int i; + int i; u_int16_t word = 0; /* @@ -536,7 +536,7 @@ fail: /* * Program the multicast filter. We use the 64-entry CAM filter * for perfect filtering. If there's more than 64 multicast addresses, - * we use the hash filter insted. + * we use the hash filter instead. */ static void vge_setmulti(sc) @@ -602,7 +602,7 @@ static void vge_reset(sc) struct vge_softc *sc; { - register int i; + int i; CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_SOFTRESET); @@ -918,10 +918,9 @@ vge_attach(dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int unit, error = 0, rid; + int error = 0, rid; sc = device_get_softc(dev); - unit = device_get_unit(dev); sc->vge_dev = dev; mtx_init(&sc->vge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, @@ -934,22 +933,22 @@ vge_attach(dev) pci_enable_busmaster(dev); rid = VGE_PCI_LOMEM; - sc->vge_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->vge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->vge_res == NULL) { - printf ("vge%d: couldn't map ports/memory\n", unit); + device_printf(dev, "couldn't map ports/memory\n"); error = ENXIO; goto fail; } /* Allocate interrupt */ rid = 0; - sc->vge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->vge_irq == NULL) { - printf("vge%d: couldn't map interrupt\n", unit); + device_printf(dev, "couldn't map interrupt\n"); error = ENXIO; goto fail; } @@ -1027,7 +1026,7 @@ vge_attach(dev) NULL, vge_intr, sc, &sc->vge_intrhand); if (error) { - printf("vge%d: couldn't set up irq\n", unit); + device_printf(dev, "couldn't set up irq\n"); ether_ifdetach(ifp); goto fail; } @@ -1179,7 +1178,7 @@ vge_newbuf(sc, idx, m) /* * Note: the manual fails to document the fact that for - * proper opration, the driver needs to replentish the RX + * proper operation, the driver needs to replenish the RX * DMA ring 4 descriptors at a time (rather than one at a * time, like most chips). We can allocate the new buffers * but we should not set the OWN bits until we're ready @@ -1971,7 +1970,7 @@ vge_init_locked(struct vge_softc *sc) /* * Configure one-shot timer for microsecond - * resulution and load it for 500 usecs. + * resolution and load it for 500 usecs. */ CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_TIMER0_RES); CSR_WRITE_2(sc, VGE_SSTIMER, 400); @@ -2261,7 +2260,7 @@ static void vge_stop(sc) struct vge_softc *sc; { - register int i; + int i; struct ifnet *ifp; VGE_LOCK_ASSERT(sc);