summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/powermac/ata_macio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/powerpc/powermac/ata_macio.c')
-rw-r--r--sys/powerpc/powermac/ata_macio.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/sys/powerpc/powermac/ata_macio.c b/sys/powerpc/powermac/ata_macio.c
index e15ab00..8505664 100644
--- a/sys/powerpc/powermac/ata_macio.c
+++ b/sys/powerpc/powermac/ata_macio.c
@@ -152,8 +152,6 @@ ata_macio_probe(device_t dev)
const char *type = ofw_bus_get_type(dev);
const char *name = ofw_bus_get_name(dev);
struct ata_macio_softc *sc;
- struct ata_channel *ch;
- int rid, i;
if (strcmp(type, "ata") != 0 &&
strcmp(type, "ide") != 0)
@@ -161,7 +159,6 @@ ata_macio_probe(device_t dev)
sc = device_get_softc(dev);
bzero(sc, sizeof(struct ata_macio_softc));
- ch = &sc->sc_ch.sc_ch;
if (strcmp(name,"ata-4") == 0) {
device_set_desc(dev,"Apple MacIO Ultra ATA Controller");
@@ -173,7 +170,23 @@ ata_macio_probe(device_t dev)
sc->max_mode = ATA_WDMA2;
}
+ return (ata_probe(dev));
+}
+
+static int
+ata_macio_attach(device_t dev)
+{
+ struct ata_macio_softc *sc = device_get_softc(dev);
+ uint32_t timingreg;
+ struct ata_channel *ch;
+ int rid, i;
+
+ /*
+ * Allocate resources
+ */
+
rid = 0;
+ ch = &sc->sc_ch.sc_ch;
sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
RF_ACTIVE);
if (sc->sc_mem == NULL) {
@@ -196,15 +209,6 @@ ata_macio_probe(device_t dev)
ch->flags |= ATA_USE_16BIT | ATA_NO_ATAPI_DMA;
ata_generic_hw(dev);
- return (ata_probe(dev));
-}
-
-static int
-ata_macio_attach(device_t dev)
-{
- struct ata_macio_softc *sc = device_get_softc(dev);
- uint32_t timingreg;
-
#if USE_DBDMA_IRQ
int dbdma_irq_rid = 1;
struct resource *dbdma_irq;
OpenPOWER on IntegriCloud