summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-10-24 00:40:07 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-10-24 00:40:07 +0000
commit379b8d15fd859ac6ce04c3586adb42c56000bfde (patch)
tree072d1caf98fff37222add9dd558ff65b64f1a43b /sys/dev/pci
parentafc635ede19de22f6e526d0261e6eceaf3ccb3be (diff)
- remove some redundnt checks before pci_mapreg_map()
- iosize -> size
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_rl_pci.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/sys/dev/pci/if_rl_pci.c b/sys/dev/pci/if_rl_pci.c
index 99871148955..5a4ad31f286 100644
--- a/sys/dev/pci/if_rl_pci.c
+++ b/sys/dev/pci/if_rl_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rl_pci.c,v 1.10 2005/09/11 18:17:08 mickey Exp $ */
+/* $OpenBSD: if_rl_pci.c,v 1.11 2005/10/24 00:40:06 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -119,32 +119,21 @@ rl_pci_attach(parent, self, aux)
pci_chipset_tag_t pc = pa->pa_pc;
pci_intr_handle_t ih;
const char *intrstr = NULL;
- bus_size_t iosize;
- u_int32_t command;
-
- command = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
-
-#ifdef RL_USEIOSPACE
- if (!(command & PCI_COMMAND_IO_ENABLE)) {
- printf(": failed to enable i/o ports\n");
- return;
- }
+ bus_size_t size;
/*
* Map control/status registers.
*/
+
+#ifdef RL_USEIOSPACE
if (pci_mapreg_map(pa, RL_PCI_LOIO, PCI_MAPREG_TYPE_IO, 0,
- &sc->rl_btag, &sc->rl_bhandle, NULL, &iosize, 0)) {
+ &sc->rl_btag, &sc->rl_bhandle, NULL, &size, 0)) {
printf(": can't map i/o space\n");
return;
}
#else
- if (!(command & PCI_COMMAND_MEM_ENABLE)) {
- printf(": failed to enable memory mapping\n");
- return;
- }
if (pci_mapreg_map(pa, RL_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0,
- &sc->rl_btag, &sc->rl_bhandle, NULL, &iosize, 0)){
+ &sc->rl_btag, &sc->rl_bhandle, NULL, &size, 0)){
printf(": can't map mem space\n");
return;
}
@@ -155,7 +144,7 @@ rl_pci_attach(parent, self, aux)
*/
if (pci_intr_map(pa, &ih)) {
printf(": couldn't map interrupt\n");
- bus_space_unmap(sc->rl_btag, sc->rl_bhandle, iosize);
+ bus_space_unmap(sc->rl_btag, sc->rl_bhandle, size);
return;
}
@@ -167,7 +156,7 @@ rl_pci_attach(parent, self, aux)
if (intrstr != NULL)
printf(" at %s", intrstr);
printf("\n");
- bus_space_unmap(sc->rl_btag, sc->rl_bhandle, iosize);
+ bus_space_unmap(sc->rl_btag, sc->rl_bhandle, size);
return;
}
printf(": %s", intrstr);