diff options
author | imp <imp@FreeBSD.org> | 2001-05-19 06:17:37 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-05-19 06:17:37 +0000 |
commit | 1a0ef36b0146047ccbfb239506991b84bb1e62e3 (patch) | |
tree | c48a3b884e3a07e81a19c5e9da9dcb2ba9540e52 /sys/pccard/pcic.c | |
parent | 9566430dfac0c03278e276bf249f5d674447e478 (diff) | |
download | FreeBSD-src-1a0ef36b0146047ccbfb239506991b84bb1e62e3.zip FreeBSD-src-1a0ef36b0146047ccbfb239506991b84bb1e62e3.tar.gz |
Initialize cinfo structure at compile time rather than run time since
they are now constant.
Diffstat (limited to 'sys/pccard/pcic.c')
-rw-r--r-- | sys/pccard/pcic.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index ee470d2..01d1633 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -66,7 +66,18 @@ static int pcic_io(struct slot *, int); devclass_t pcic_devclass; -static struct slot_ctrl cinfo; +static struct slot_ctrl pcic_cinfo = { + pcic_mapirq, + pcic_memory, + pcic_io, + pcic_reset, + pcic_disable, + pcic_power, + pcic_ioctl, + pcic_resume, + PCIC_MEM_WIN, + PCIC_IO_WIN +}; /* * Clear bit(s) of a register. @@ -240,20 +251,6 @@ pcic_attach(device_t dev) struct pcic_slot *sp; int stat; - /* - * Initialise controller information structure. - */ - cinfo.mapirq = pcic_mapirq; - cinfo.mapmem = pcic_memory; - cinfo.mapio = pcic_io; - cinfo.ioctl = pcic_ioctl; - cinfo.power = pcic_power; - cinfo.reset = pcic_reset; - cinfo.disable = pcic_disable; - cinfo.resume = pcic_resume; - cinfo.maxmem = PCIC_MEM_WIN; - cinfo.maxio = PCIC_IO_WIN; - sc = (struct pcic_softc *) device_get_softc(dev); sp = &sc->slots[0]; for (i = 0; i < PCIC_CARD_SLOTS; i++, sp++) { @@ -266,7 +263,7 @@ pcic_attach(device_t dev) return (ENXIO); } device_probe_and_attach(kid); - slt = pccard_init_slot(kid, &cinfo); + slt = pccard_init_slot(kid, &pcic_cinfo); if (slt == 0) { device_printf(dev, "Can't get pccard info slot %d", i); return (ENXIO); |