aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/dpt/dpt_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/dpt/dpt_pci.c')
-rw-r--r--sys/dev/dpt/dpt_pci.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/sys/dev/dpt/dpt_pci.c b/sys/dev/dpt/dpt_pci.c
index 0003e9986b82..150d5cd02a87 100644
--- a/sys/dev/dpt/dpt_pci.c
+++ b/sys/dev/dpt/dpt_pci.c
@@ -75,13 +75,13 @@ static int
dpt_pci_attach (device_t dev)
{
dpt_softc_t * dpt;
- int s;
int error = 0;
u_int32_t command;
dpt = device_get_softc(dev);
dpt->dev = dev;
+ dpt_alloc(dev);
command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1);
@@ -117,8 +117,7 @@ dpt_pci_attach (device_t dev)
}
/* Ensure busmastering is enabled */
- command |= PCIM_CMD_BUSMASTEREN;
- pci_write_config(dev, PCIR_COMMAND, command, /*bytes*/1);
+ pci_enable_busmaster(dev);
if (rman_get_start(dpt->io_res) == (ISA_PRIMARY_WD_ADDRESS - 0x10)) {
#ifdef DPT_DEBUG_WARN
@@ -129,8 +128,6 @@ dpt_pci_attach (device_t dev)
goto bad;
}
- dpt_alloc(dev);
-
/* Allocate a dmatag representing the capabilities of this attachment */
if (bus_dma_tag_create( /* PCI parent */ bus_get_dma_tag(dev),
/* alignemnt */ 1,
@@ -143,15 +140,13 @@ dpt_pci_attach (device_t dev)
/* nsegments */ ~0,
/* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT,
/* flags */ 0,
- /* lockfunc */ busdma_lock_mutex,
- /* lockarg */ &Giant,
+ /* lockfunc */ NULL,
+ /* lockarg */ NULL,
&dpt->parent_dmat) != 0) {
error = ENXIO;
goto bad;
}
- s = splcam();
-
if (dpt_init(dpt) != 0) {
error = ENXIO;
goto bad;
@@ -160,10 +155,8 @@ dpt_pci_attach (device_t dev)
/* Register with the XPT */
dpt_attach(dpt);
- splx(s);
-
- if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY,
- NULL, dpt_intr, dpt, &dpt->ih)) {
+ if (bus_setup_intr(dev, dpt->irq_res, INTR_TYPE_CAM | INTR_ENTROPY |
+ INTR_MPSAFE, NULL, dpt_intr, dpt, &dpt->ih)) {
device_printf(dev, "Unable to register interrupt handler\n");
error = ENXIO;
goto bad;