From 995823e99992edd36ded82114281d367b683c79e Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 25 May 2001 18:28:49 +0000 Subject: [PATCH] Migrate from unit based to dev base. Don't save unit number, but do save dev. Convert all uses of unit to dev as appropriate. Minor comment fixes to pcic_softc definition. --- sys/pccard/pcic.c | 4 ++-- sys/pccard/pcic_isa.c | 2 +- sys/pccard/pcicvar.h | 22 ++++++++++++---------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index 2316f74fa4d..7e3496c8c38 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -623,8 +623,8 @@ pcictimeout(void *chan) struct pcic_softc *sc = (struct pcic_softc *) chan; if (pcicintr1(chan) != 0) { - printf("pcic%d: Static bug detected, ignoring hardware.\n", - ((struct pcic_softc *)chan)->unit); + device_printf(sc->dev, + "Static bug detected, ignoring hardware."); return; } sc->timeout_ch = timeout(pcictimeout, chan, hz/2); diff --git a/sys/pccard/pcic_isa.c b/sys/pccard/pcic_isa.c index 5f82180fb40..5e18bb21a61 100644 --- a/sys/pccard/pcic_isa.c +++ b/sys/pccard/pcic_isa.c @@ -107,7 +107,7 @@ pcic_isa_probe(device_t dev) } sc = (struct pcic_softc *) device_get_softc(dev); - sc->unit = device_get_unit(dev); + sc->dev = dev; sp = &sc->slots[0]; for (slotnum = 0; slotnum < PCIC_CARD_SLOTS; slotnum++, sp++) { /* diff --git a/sys/pccard/pcicvar.h b/sys/pccard/pcicvar.h index e11f4861d3d..7fd6c562af2 100644 --- a/sys/pccard/pcicvar.h +++ b/sys/pccard/pcicvar.h @@ -42,22 +42,24 @@ struct pcic_slot { struct pcic_softc { - u_int32_t slotmask; /* Mask of valid slots */ - u_int32_t flags; /* Interesting flags */ + u_int32_t slotmask;/* Mask of valid slots */ + u_int32_t flags; /* Interesting flags */ #define PCIC_AB_POWER 0x00000001 /* Use old A/B step power */ #define PCIC_DF_POWER 0x00000002 /* Uses DF step regs */ #define PCIC_PD_POWER 0x00000004 /* Uses CL-PD regs */ #define PCIC_VG_POWER 0x00000008 /* Uses VG power regs */ #define PCIC_KING_POWER 0x00000010 /* Uses IBM KING regs */ #define PCIC_RICOH_POWER 0x00000020 /* Uses the ricoh power regs */ - int iorid; /* Rid of I/O region */ - struct resource *iores; /* resource for I/O region */ - int memrid; - struct resource *memres; - int irqrid; - struct resource *irqres; - void *ih; - int unit; + int iorid; /* Rid of I/O region */ + struct resource *iores; /* resource for I/O region */ + int memrid; /* Memory rid */ + struct resource *memres;/* Resource for memory mapped regs */ + int irqrid; /* Irq rid */ + struct resource *irqres;/* Irq resource */ + void *ih; /* Our interrupt handler. */ + device_t dev; /* Our device */ + bus_space_tag_t bst; /* Bus tag for our regs */ + bus_space_handle_t bsh; /* Bus handle for our regs */ struct callout_handle timeout_ch; struct pcic_slot slots[PCIC_MAX_SLOTS]; };