diff options
Diffstat (limited to 'sys/dev/mvs')
-rw-r--r-- | sys/dev/mvs/mvs.c | 6 | ||||
-rw-r--r-- | sys/dev/mvs/mvs_pci.c | 15 | ||||
-rw-r--r-- | sys/dev/mvs/mvs_soc.c | 22 |
3 files changed, 20 insertions, 23 deletions
diff --git a/sys/dev/mvs/mvs.c b/sys/dev/mvs/mvs.c index a98a59259581..4132af157a62 100644 --- a/sys/dev/mvs/mvs.c +++ b/sys/dev/mvs/mvs.c @@ -37,8 +37,8 @@ #include <sys/malloc.h> #include <sys/lock.h> #include <sys/mutex.h> +#include <sys/stdarg.h> #include <vm/uma.h> -#include <machine/stdarg.h> #include <machine/resource.h> #include <machine/bus.h> #include <sys/rman.h> @@ -105,7 +105,7 @@ static int mvs_ch_probe(device_t dev) { - device_set_desc_copy(dev, "Marvell SATA channel"); + device_set_desc(dev, "Marvell SATA channel"); return (BUS_PROBE_DEFAULT); } @@ -1798,7 +1798,7 @@ completeall: } xpt_setup_ccb(&ccb->ccb_h, ch->hold[i]->ccb_h.path, ch->hold[i]->ccb_h.pinfo.priority); - if (ccb->ccb_h.func_code == XPT_ATA_IO) { + if (ch->hold[i]->ccb_h.func_code == XPT_ATA_IO) { /* READ LOG */ ccb->ccb_h.recovery_type = RECOVERY_READ_LOG; ccb->ccb_h.func_code = XPT_ATA_IO; diff --git a/sys/dev/mvs/mvs_pci.c b/sys/dev/mvs/mvs_pci.c index be9351403a0d..f0df709db732 100644 --- a/sys/dev/mvs/mvs_pci.c +++ b/sys/dev/mvs/mvs_pci.c @@ -36,8 +36,8 @@ #include <sys/lock.h> #include <sys/mutex.h> #include <sys/sbuf.h> +#include <sys/stdarg.h> #include <vm/uma.h> -#include <machine/stdarg.h> #include <machine/resource.h> #include <machine/bus.h> #include <sys/rman.h> @@ -77,7 +77,6 @@ static struct { static int mvs_probe(device_t dev) { - char buf[64]; int i; uint32_t devid = pci_get_devid(dev); uint8_t revid = pci_get_revid(dev); @@ -85,9 +84,8 @@ mvs_probe(device_t dev) for (i = 0; mvs_ids[i].id != 0; i++) { if (mvs_ids[i].id == devid && mvs_ids[i].rev <= revid) { - snprintf(buf, sizeof(buf), "%s SATA controller", + device_set_descf(dev, "%s SATA controller", mvs_ids[i].name); - device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } } @@ -164,13 +162,13 @@ mvs_attach(device_t dev) } /* Attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { - child = device_add_child(dev, "mvsch", -1); + child = device_add_child(dev, "mvsch", DEVICE_UNIT_ANY); if (child == NULL) device_printf(dev, "failed to add channel device\n"); else device_set_ivars(child, (void *)(intptr_t)unit); } - bus_generic_attach(dev); + bus_attach_children(dev); return 0; } @@ -178,9 +176,12 @@ static int mvs_detach(device_t dev) { struct mvs_controller *ctlr = device_get_softc(dev); + int error; /* Detach & delete all children */ - device_delete_children(dev); + error = bus_generic_detach(dev); + if (error != 0) + return (error); /* Free interrupt. */ if (ctlr->irq.r_irq) { diff --git a/sys/dev/mvs/mvs_soc.c b/sys/dev/mvs/mvs_soc.c index 696b65d54359..5bafc07847b4 100644 --- a/sys/dev/mvs/mvs_soc.c +++ b/sys/dev/mvs/mvs_soc.c @@ -35,8 +35,8 @@ #include <sys/malloc.h> #include <sys/lock.h> #include <sys/mutex.h> +#include <sys/stdarg.h> #include <vm/uma.h> -#include <machine/stdarg.h> #include <machine/resource.h> #include <machine/bus.h> #include <sys/rman.h> @@ -61,11 +61,6 @@ static struct { int ports; int quirks; } mvs_ids[] = { - {MV_DEV_88F5182, 0x00, "Marvell 88F5182", 2, MVS_Q_GENIIE|MVS_Q_SOC}, - {MV_DEV_88F6281, 0x00, "Marvell 88F6281", 2, MVS_Q_GENIIE|MVS_Q_SOC}, - {MV_DEV_88F6282, 0x00, "Marvell 88F6282", 2, MVS_Q_GENIIE|MVS_Q_SOC}, - {MV_DEV_MV78100, 0x00, "Marvell MV78100", 2, MVS_Q_GENIIE|MVS_Q_SOC}, - {MV_DEV_MV78100_Z0, 0x00,"Marvell MV78100", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_MV78260, 0x00, "Marvell MV78260", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_MV78460, 0x00, "Marvell MV78460", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {0, 0x00, NULL, 0, 0} @@ -74,7 +69,6 @@ static struct { static int mvs_probe(device_t dev) { - char buf[64]; int i; uint32_t devid, revid; @@ -88,9 +82,8 @@ mvs_probe(device_t dev) for (i = 0; mvs_ids[i].id != 0; i++) { if (mvs_ids[i].id == devid && mvs_ids[i].rev <= revid) { - snprintf(buf, sizeof(buf), "%s SATA controller", + device_set_descf(dev, "%s SATA controller", mvs_ids[i].name); - device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } } @@ -168,13 +161,13 @@ mvs_attach(device_t dev) } /* Attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { - child = device_add_child(dev, "mvsch", -1); + child = device_add_child(dev, "mvsch", DEVICE_UNIT_ANY); if (child == NULL) device_printf(dev, "failed to add channel device\n"); else device_set_ivars(child, (void *)(intptr_t)unit); } - bus_generic_attach(dev); + bus_attach_children(dev); return 0; } @@ -182,9 +175,12 @@ static int mvs_detach(device_t dev) { struct mvs_controller *ctlr = device_get_softc(dev); + int error; /* Detach & delete all children */ - device_delete_children(dev); + error = bus_generic_detach(dev); + if (error != 0) + return (error); /* Free interrupt. */ if (ctlr->irq.r_irq) { @@ -374,7 +370,7 @@ mvs_release_resource(device_t dev, device_t child, struct resource *r) rman_release_resource(r); return (0); case SYS_RES_IRQ: - if (rid != ATA_IRQ_RID) + if (rman_get_rid(r) != ATA_IRQ_RID) return ENOENT; return (0); } |