From 37a55c7ec422afd8d71d38197362659be6a4a63b Mon Sep 17 00:00:00 2001 From: grehan Date: Fri, 23 Apr 2004 23:39:53 +0000 Subject: - Catch up with recent ATA changes. - Remove trailing space in ata_macio.c --- sys/powerpc/powermac/ata_kauai.c | 2 ++ sys/powerpc/powermac/ata_macio.c | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'sys/powerpc/powermac') diff --git a/sys/powerpc/powermac/ata_kauai.c b/sys/powerpc/powermac/ata_kauai.c index f8817b1..47d8115 100644 --- a/sys/powerpc/powermac/ata_kauai.c +++ b/sys/powerpc/powermac/ata_kauai.c @@ -169,6 +169,7 @@ ata_kauai_probe(device_t dev) } ch = device_get_softc(dev); + bzero(ch, sizeof(struct ata_channel)); rid = PCIR_BARS; mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -192,6 +193,7 @@ ata_kauai_probe(device_t dev) ch->locking = ata_kauai_locknoop; ch->device[MASTER].setmode = ata_kauai_setmode; ch->device[SLAVE].setmode = ata_kauai_setmode; + ata_generic_hw(ch); return (ata_probe(dev)); } diff --git a/sys/powerpc/powermac/ata_macio.c b/sys/powerpc/powermac/ata_macio.c index 0a0983f..127defe 100644 --- a/sys/powerpc/powermac/ata_macio.c +++ b/sys/powerpc/powermac/ata_macio.c @@ -50,9 +50,9 @@ #include #include -/* +/* * Offset to control registers from base -*/ + */ #define ATA_MACIO_ALTOFFSET 0x160 /* @@ -109,14 +109,14 @@ ata_macio_probe(device_t dev) return (ENXIO); ch = device_get_softc(dev); + bzero(ch, sizeof(struct ata_channel)); rid = 0; - mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~1, 1, - RF_ACTIVE); + mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (mem == NULL) { device_printf(dev, "could not allocate memory\n"); return (ENXIO); - } + } /* * Set up the resource vectors @@ -128,11 +128,12 @@ ata_macio_probe(device_t dev) ch->r_io[ATA_ALTSTAT].res = mem; ch->r_io[ATA_ALTSTAT].offset = ATA_MACIO_ALTOFFSET; - ch->unit = 0; + ch->unit = 0; ch->flags |= ATA_USE_16BIT; ch->locking = ata_macio_locknoop; ch->device[MASTER].setmode = ata_macio_setmode; ch->device[SLAVE].setmode = ata_macio_setmode; + ata_generic_hw(ch); return (ata_probe(dev)); } -- cgit v1.1