From 74c95b7f29ae970fc99cad21e8ea772eb2557bd1 Mon Sep 17 00:00:00 2001 From: mdodd Date: Wed, 16 Apr 2003 03:16:57 +0000 Subject: - Don't call pci_enable_io() in drivers (unless needed for resume). - Don't test memory/port status and emit an error message; the PCI bus code will do this now. --- sys/pci/if_pcn.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'sys/pci/if_pcn.c') diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c index 3c60e0f..eb92207 100644 --- a/sys/pci/if_pcn.c +++ b/sys/pci/if_pcn.c @@ -543,23 +543,12 @@ pcn_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); -#ifdef PCN_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("pcn%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("pcn%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif + /* Retreive the chip ID */ + command = pcn_chip_id(dev); + sc->pcn_type = (command >>= 12) & PART_MASK; + device_printf(dev, "Chip ID %04x (%s)\n", + sc->pcn_type, pcn_chipid_name(sc->pcn_type)); rid = PCN_RID; sc->pcn_res = bus_alloc_resource(dev, PCN_RES, &rid, -- cgit v1.1