diff --git a/sys/powerpc/powermac/ata_kauai.c b/sys/powerpc/powermac/ata_kauai.c --- a/sys/powerpc/powermac/ata_kauai.c +++ b/sys/powerpc/powermac/ata_kauai.c @@ -196,9 +196,7 @@ static int ata_kauai_probe(device_t dev) { - struct ata_kauai_softc *sc; u_int32_t devid; - const char *compatstring = NULL; int i, found; found = 0; @@ -213,18 +211,6 @@ if (!found) return (ENXIO); - sc = device_get_softc(dev); - bzero(sc, sizeof(struct ata_kauai_softc)); - - compatstring = ofw_bus_get_compat(dev); - if (compatstring != NULL && strcmp(compatstring,"shasta-ata") == 0) - sc->shasta = 1; - - /* Pre-K2 controllers apparently need this hack */ - if (!sc->shasta && - (compatstring == NULL || strcmp(compatstring, "K2-UATA") != 0)) - bus_set_resource(dev, SYS_RES_IRQ, 0, 39, 1); - return (ata_probe(dev)); } @@ -245,6 +231,7 @@ { struct ata_kauai_softc *sc = device_get_softc(dev); struct ata_channel *ch; + const char *compatstring; int i, rid; #if USE_DBDMA_IRQ int dbdma_irq_rid = 1; @@ -252,6 +239,15 @@ void *cookie; #endif + compatstring = ofw_bus_get_compat(dev); + if (compatstring != NULL && strcmp(compatstring,"shasta-ata") == 0) + sc->shasta = 1; + + /* Pre-K2 controllers apparently need this hack */ + if (!sc->shasta && + (compatstring == NULL || strcmp(compatstring, "K2-UATA") != 0)) + bus_set_resource(dev, SYS_RES_IRQ, 0, 39, 1); + ch = &sc->sc_ch.sc_ch; rid = PCIR_BARS;